Build the jar with the code?

Answered

My project results in a jar file, which I can make with Build→Build Artifacts.  So I finish testing, check everything in, copy over the jar file, and crap, I forgot to rebuild the jar.

Is there any way I can automatically build the jar whenever I build the code?

0
2 comments

Yes, you can have the JAR build as part of the normal project build. 

Open Project Structure, pick Artifacts on the left, select your JAR artifact, and turn on the **Include in project build** checkbox. After that, every Build | Build Project rebuilds the JAR alongside the code. 

Reference: https://www.jetbrains.com/help/idea/working-with-artifacts.html 

If you only need the JAR rebuilt before a specific Run/Debug configuration (not on every project build), add a Before launch | Build Artifacts step to that run configuration. It will rebuild the JAR each time you run that configuration.

0

My bad, I thought I'd checked that.  I thought wrong.

 

Thanks!

0

Please sign in to leave a comment.