IntelliJ automatically creates artifacts when code changes

Is there a way to automatically build artifacts in a project in the same way that it automatically creates output? The shortcut key will also work if it exists. Now I need to click Build -> Build Artifacts -> Build , which is cumbersome.

Edit: my β€œartifact” in this case is just the jar file of my project.

+5
source share
1 answer

An old question, but hoping it will be useful to others.

You can set that artifacts will be automatically updated when a project is created, instead of manually creating artifacts with each update: open the project settings ( File -> Project Structure ) and on the Artifacts tab check Include in project build (screenshot of IntelliJ IDEA Ultimate 2017.1 ):

IntellJ Build Artifacts Automatically

Edit:

To ensure that artifacts created automatically when the source changes are similar to automatic assembly, see the procedure described in @CrazyCoder's answer, which was commented above:

deploy / debug Java code on a remote server using Intellij

Indication of additional necessary steps from this answer adapted for IntelliJ IDEA Ultimate 2017.1:

  • Open File -> Settings -> Build, Execution, Deployment .
  • In Options set Upload changes files automatically to the default server to On explicit save action (Ctrl + S) .
  • Check the Upload external changes box below.
+3
source

Source: https://habr.com/ru/post/1268515/


All Articles