barron
barron

Reputation: 123

Export jar with spring boot

I need to export executable jar from intellij spring boot project. its basic rest only. How can it possible. I have created the artifact jar and when i try to run it with java -jar xxx.jar it returns manifest file not found error.

Upvotes: 4

Views: 3604

Answers (2)

nortontgueno
nortontgueno

Reputation: 2791

Generally you have this error when you generate the JAR using the IDE directly (export option of Eclipse for example).

You can either use the Maven goals clean install or clean package to compile and generate the JAR in your target folder and/or local repository.

package - take the compiled code and package it in its distributable format, such as a JAR.

install - install the package into the local repository, for use as a dependency in other projects locally

The install will execute the package one step before install it on your local repository.

Maven Lifecycle Documentation

Upvotes: 2

Anuj Poudel
Anuj Poudel

Reputation: 1

If you have installed maven, On the terminal of Intellij Idea use following code.

mvn clean package


Your Jar will be saved inside "target" folder inside the project directory

Upvotes: 0

Related Questions