Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "IntelliJ", "Maven" and "Gradle" build system in IntelliJ IDEA?

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?

like image 902
henry-jo Avatar asked Sep 02 '25 04:09

henry-jo


2 Answers

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.

like image 180
vikingsteve Avatar answered Sep 05 '25 00:09

vikingsteve


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.

like image 23
liming Avatar answered Sep 05 '25 01:09

liming