Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify artifact name with Intellij

I'd like to set the filename of the jar artifact that I build with Intellij, but as I change it, it doesn't change in the output file.

enter image description here

like image 543
turinho Avatar asked Feb 24 '14 11:02

turinho


2 Answers

Using 2017.2.5 I am able to change the artifact name using the following steps:

  1. File > Project Structure.
  2. Under Project Settings > Artifacts.
  3. Add a new or modify existing artifact.
  4. Under Output Layout you can actually rename your JAR file to whatever you want, be sure to hit on enter to have the IDE eat up the change.

Screenshot:

Changing Name of JAR File

like image 119
Rejinderi Avatar answered Sep 25 '22 21:09

Rejinderi


Here is a workaround to change the filename of the JAR artifact...

  1. From the Project pane, rename the module to what you'd like the JAR file to be named. The filename of the JAR is is captured from the name of the module at the time you create the artifact config.
  2. Go into Build Artifacts->Edit.. and delete the old artifact that is making the wrong JAR file name.
  3. Add a new JAR Artifact. This new artifact will use whatever the name of the module is.
  4. You can now go back and change the module name back.

Ugly, but works.

Note that you will likely hit this bug next, so make sure you do not use the default main/java path to the manifest. Instead manually change it to main/resources - and then go vote to have both these bugs fixed!

like image 30
bigjosh Avatar answered Sep 24 '22 21:09

bigjosh