I created a new maven project in IntelliJ and set packaging to jar but when I build it, the target folder does not contain a jar. I'm sure its something really dumb on my part but there are just so many different things i'm reading on different websites and I just feel better asking.
To create a JAR file from a Maven project in IntelliJ IDEA, go to the Maven Tool Window (View → Tool Windows → Maven), expand your project in the tree, expand Lifecycle, and then double-click on package. Maven will compile your package, and the compiled JAR file will be written to the target/ directory.
Creating Web Application using Maven in IntelliJ. 1 Start by creating a new project in IntelliJ. Upon opening IntelliJ, click Create New Project. On the left side, click Maven. Select the Project SDK or ... 2 Create the Folder Structure. 3 Configure pom.xml. 4 Deploying/Running the Project.
Let’s see how to do it. To create a JAR file from a Maven project in IntelliJ IDEA, go to the Maven Tool Window (View → Tool Windows → Maven), expand your project in the tree, expand Lifecycle, and then double-click on package. Maven will compile your package, and the compiled JAR file will be written to the target/ directory.
maven-archetype-quickstart archetype plugin is used to create a quick and simple java application. Launch IntelliJ IDEA. Click on Create New Project. Select Maven build tool from the left menu. Check the option Create from the archetype. Select the quickstart archetype to create a simple java project and click on the Next button.
You should build you project using IDEA's Maven Projects
view.
View -> Tool Windows -> Maven Projects
or open it from left bottom corner menu:
And then build your project with maven goals - i.e. package:
If packaging is set to jar
in pom.xml
, you will get a jar in target
dir.
Go to the maven project and double click clean and package.
For just do following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With