Maven Jar within Intellij

Intellij is great, but its integration with maven still needs some work.

Here are some steps to create a jar from within Intellij Idea (Community 2017)

Method 1: Creating artifact from IntelliJ:

  • Go to project structure:

File menu

  • Create a new artifact:

Create a new artifact

  • Select the main class, and be sure to change the manifest folder:

enter image description here

You have to change manifest directory (whoa??):


<project folder>\src\main\java 


<project folder>\src\main\resources

This is how it should look like:

correct way for new manifest

  • Then you choose the dependencies what you want to be packed IN your jar, or NEAR your jar file
  • To build your artifact go to build artifacts and choose “rebuild”. It will create an “out” folder with your jar file and its dependencies.

enter image description here

Method 2: Using maven-assembly-plugin (preferred)

Add build section to the pom file

  • Create a new run/debug configuration:

Create a new run/debug configuration:

  • Choose application:

Choose application

  • Fill in the form
  • Add the “assembly:single” maven goal after build to be executed last

enter image description here

Final setup

  • Save it, then run

enter image description here

This procedure will create the jar file under the “target” folder

JAR file location


One thought on “Maven Jar within Intellij”

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s