javamavengradleintellij-ideabuild-system

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?


Solution

  • 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.