13

What is the difference between IntelliJ, Maven and Gradle build system in IntelliJ IDEA?
Has IntelliJ IDEA its own build system? IntelliJ IDEA - New Project In addition, what is the difference between run in IntelliJ and Gradle bootRun?

Ola Ström
  • 4,136
  • 5
  • 22
  • 41
henry-jo
  • 283
  • 1
  • 3
  • 14
  • It's integrated support for gradle, which is a completely distinct build system from the IDE. The IDE will use whatever build system you choose, but defaults to `javac` – Rogue Aug 13 '19 at 04:01

3 Answers3

15

Build project is IntelliJ's own built-in build mechanism, it simply compiles all modified and dependent files in the project.

However, it's a "plain vanilla" build. It doesnt do fancy things like creating artifacts, deploying to repositories, codegen from a wsdl - etc. That's what we use build automation tools for, and there are 2 of them (maven and gradle) in widsepread use.

Maven and gradle allow developers to set up a custom (and more complex) build configuration.

The maven pom.xml defines lifecycle goals and the gradle build.gradle defines tasks.

Via a plugin architecture, maven / gradle can accomplish almost anything in a build process. Whilst the maven / gradle "run" task can operate similarly to IntelliJ "Build Project", it's not the same thing - in this case the build is instrumented by the build tool (maven or gradle) and can be configured differently, and be part of a more complicated build process.

Additionally, maven has build "profiles" that can build the project in different ways.

vikingsteve
  • 38,481
  • 23
  • 112
  • 156
4

I tested this locally in my project, using two builds: one using IntelliJ IDEA's "build project" and the second using Gradle's own build command.

Then I checked the contents of the .build directory in my project and found that the former (IntelliJ IDEA's build) produced less files than the latter (Gradle). I think Gradle's build system is more powerful than IntelliJ IDEA's, which is why I prefer to use Gradle in my projects.

Martin Devillers
  • 17,293
  • 5
  • 46
  • 88
liming
  • 41
  • 1
3

What is difference build project in IntelliJ and gradle build?

IntelliJ build uses IDE's own jps project model and builder for compiling the java-based projects. Including incremental build support.

With Gradle build it actually uses Gradle to build the project (think Gradle build task).

In addition, What is difference run in IntelliJ and gradle bootRun?

Basically same as above: IntelliJ runner - uses build results of IDE's builder and IDE's own Run/Debug Configuration to launch the application ant tests. With Gradle runner - IDE delegates this to corresponding (bootRun) Gradle task.

See also Configure the build and run actions for additional details.

Andrey
  • 15,144
  • 25
  • 91
  • 187