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.
Specify artifact name with Intellij
Asked Answered
Not enough information. Make screenshot. –
Veinule
Might be a stupid suggestion, but did you press Apply? –
Welton
Yes I did, it keeps to generete the file with the old name –
Morna
I'm seeing the exact same thing. No matter what I do, it stays IntelliJ.jar (the name of my module/project) –
Grillage
Using 2017.2.5 I am able to change the artifact name using the following steps:
- File > Project Structure.
- Under Project Settings > Artifacts.
- Add a new or modify existing artifact.
- 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:
The key piece of information for me was to press Enter. On the Mac, pressing Return isn't enough. Press the real Enter key (on the keypad) or Fn-Return on a keyboard without a separate Enter key. –
Mikiso
Here is a workaround to change the filename of the JAR artifact...
- 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.
- Go into
Build Artifacts->Edit..
and delete the old artifact that is making the wrong JAR file name. - Add a new JAR Artifact. This new artifact will use whatever the name of the module is.
- 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!
© 2022 - 2024 — McMap. All rights reserved.