Is there a way to automatically build artifacts in a project just like how it automatically build the output? A shortcut key would also work if it exists -- right now I need to click on Build -> Build Artifacts -> Build
which is cumbersome.
Edit: my "artifact" in this case is just a jar file of my project output.
From the main menu, select File | Project Structure ( Ctrl+Alt+Shift+S ) and click Artifacts. and select an artifact format. On the page that opens in the right-hand part of the dialog, specify the artifact settings and contents.
Configure the basic artifact settingsOpen the Project Structure dialog (e.g. Ctrl+Alt+Shift+S ). Click Artifacts to open the Artifacts page. Do one of the following: To use a pre-defined exploded directory artifact, select the <module name>war:exploded artifact from the list on the left-hand pane.
It's likely that you haven't configured that you want to build a . JAR/Artifact. and click on the Artifacts tab on the side. Then click the Green + at the top, you'll be able to configure your project to build an artifact.
Using exploded deployment allows updating application without redeploying or restarting the server. The server doesn't need to unpack the web application when it's deployed, it just uses the files that are present in the directory.
Old question, but posting this hoping it'll be useful to others.
You could set the artifacts to be updated automatically when the project is built, rather than having to manually build the artifacts on each update: open the project settings (File -> Project Structure
), and in the Artifacts
tab check Include in project build
(screenshot IntelliJ IDEA Ultimate 2017.1):
Edit:
For having the artifacts built automatically upon source change, similar to automatic build, refer to the procedure described in @CrazyCoder answer that was commented above:
deploy/debug java code on a remote server using Intellij
Quoting the additional needed steps from this answer, adapted for IntelliJ IDEA Ultimate 2017.1:
File -> Settings -> Build, Execution, Deployment
.Options
, set the Upload changes files automatically to the default server
to On explicit save action (Ctrl + S)
.Upload external changes
box below.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With