Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ automatically build artifacts when code changes

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.

like image 718
JRR Avatar asked Jun 04 '17 05:06

JRR


People also ask

How do I enable build artifacts in IntelliJ?

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.

How do you deploy artifacts in IntelliJ?

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.

Why can I build artifacts IntelliJ?

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.

What is exploded war in IntelliJ?

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.


1 Answers

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):

IntellJ Build Artifacts Automatically

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:

  • Open File -> Settings -> Build, Execution, Deployment.
  • Under Options, set the Upload changes files automatically to the default server to On explicit save action (Ctrl + S).
  • Check the Upload external changes box below.
like image 90
valiano Avatar answered Nov 15 '22 09:11

valiano