IntelliJ IDEA 2019.1 Help

Delegate build and run actions to Maven

If you want to build your project and run Maven goals 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 Projects tool window. Alternatively, on 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 Java 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 you run your main method (Ctrl+Shift+F10), IntelliJ IDEA will also use Maven to run the class.

Last modified: 20 June 2019