IntelliJ IDEA 2019.2 Help

Delegate build and run actions to Maven

If you want to build your project and execute run actions through Maven, you need to delegate all those actions to Maven with the Delegate IDE build/run actions to maven option located in the Maven settings.

In this case when you build a project (Build | Build Project), IntelliJ IDEA invokes the appropriate Maven goals.

Build tool window
Also, the Run and Debug actions from the Run menu are executed with Maven. HotSwap is also gets triggered and the classes are reloaded during a debugging process.

Build a project with Maven

  1. Click icons general settings svg in the Maven tool window. Alternatively, from the main menu select File | Settings/Preferences | Build, Execution, Deployment |Build Tools | Maven.

  2. Click Maven and from the list, select Runner.

  3. On the Runner page, select Delegate IDE build/run actions to maven.

    maven settings delegate

  4. Click OK.

  5. Open any project with the pom.xml file.

  6. Invoke the Build Project action Ctrl+F9. Maven compiles the code and displays it in the Build tool window. If, for example, you run the main method Ctrl+Shift+F10 in your Java project, IntelliJ IDEA will also use Maven to run the class.

Last modified: 20 September 2019