Build the jar with the code?
已回答
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?
请先登录再写评论。
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.
My bad, I thought I'd checked that. I thought wrong.
Thanks!