IntelliJ IDEA 2024.3 Help

Build actions overview

IntelliJ IDEA offers a lot of actions depending on a tool or a framework that is enabled in your project. Many of those actions are located in different parts of the IDE.

When you work with various build tools in IntelliJ IDEA, it might be challenging to figure out which build action is more suitable to your build process.

Build main menu action

Unless you delegate the build process to one of the build tools, you can use IntelliJ IDEA to build your project. We recommend using IntelliJ IDEA for building when you have a small project and need to quickly check the compiled output.

Build a project with IntelliJ IDEA

  • Go to Build | Build Project. Alternatively, press Ctrl+F9 to build your project.

    IntelliJ IDEA compiles all the classes inside your build target and places them inside the output directory.

    You can check the result in the Build tool window.

For more information, refer to Compile and build applications with IntelliJ IDEA.

Build with Gradle

If you have a Gradle project then by default the build process is delegated to Gradle.

You can invoke the project building by using the main menu, or you can use the Gradle tool window. However, invoking the build from the main menu, will only compile the code.

Use build action from the main menu

  • Go to Build | Build Project. Alternatively, press Ctrl+F9 to compile your project.

    Gradle runs the classes and testClasses tasks only.

    You can check the result in the Build tool window.

    Build tool window

In a Gradle project, the Gradle tool window is the main part of your work process. It displays a structure of the build cycle, a list of tasks that you can execute, and a list of dependencies used in the project. In addition, you can perform various actions such as linking a project, reloading it, and so on.

Gradle tool window

If you run the build task in the Gradle tool window, you will get the full build process such as generating classes, running tests, packaging, and so on.

Run the build task

  1. In the Gradle tool window, click the Tasks node.

  2. Click the build node and double-click the build task.

    Check the result in the Run tool window.

    Run tool window

For more information about Gradle tasks, refer to the Gradle tasks section.

Build with Maven

If you have a Maven project, then you can use IntelliJ IDEA to compile and run tests for the project.

Use build action from the main menu

  • Go to Build | Build Project. Alternatively, press Ctrl+F9 to compile your project.

    IntelliJ IDEA compiles all the classes inside your build target and places them inside the output directory.

    You can check the result in the Build tool window.

    Build tool window

If you have a highly customized build process or run into problems building with IntelliJ IDEA, you can delegate your build to Maven.

In this case, use the Maven tool window for compiling, building and deploying the project. The package goal in this case is the goal that you can run to build your project.

Maven tool window

Run the package goal

  1. In the Maven tool window, click the Lifecycle node.

  2. Double-click the package goal to run it.

    Check the result in the Run tool window.

    Run tool window

    Use available tool window icons to adjust the displayed results.

For more information about Maven goals, refer to the Maven goals section.

Last modified: 11 February 2024