In IntelliJ 14.1 what exactly happens when Build > Rebuild Project
is invoked for a maven project.
I have tried to testing this and when I click Build > Rebuild Project
I can't see any console output indicating that maven is running, if I run maven from the maven projects view I get maven output.
So what exactly is the relationship between IntelliJ Build > Rebuild
Project and build tools such as maven / gradle / ant
?
Rebuild When you execute a rebuild command, IntelliJ IDEA cleans out the entire output directory, deletes the build caches and builds a project, or a module from scratch. It might be helpful, when the classpath entries have changed. For example, SDKs or libraries that the project uses are added, removed or altered.
Basically, "Build Artifact" is a conditional build, meaning it will only build if there is any modified code. If you haven't changed anything, it won't do anything. "Rebuild Artifact", however, will force a build from scratch no matter if there are code changes or not.
IntelliJ IDEA supports a fully-functional integration with Maven that helps you automate your building process. You can easily create a new Maven project, open and sync an existing one, add a Maven support to any existing IntelliJ IDEA project, configure and manage a multi-module project.
No, the IntelliJ IDEA make does not invoke Maven. When you open a Maven or Gradle project, it reads the settings of the project and stores them as part of its internal project model. When you invoke Build, it uses the imported settings to compile your project using its own build system. Rebuild Project keeps the existing imported settings, deletes all .class files and IntelliJ's incremental compilation caches, and performs a full build of the project using IntelliJ IDEA's build system.
The advantage of doing that is that the IntelliJ IDEA build system supports very fine-grained incremental rebuilds (for example, if you change the signature of the method, it will recompile only those classes which actually call the method, and not any other code).
Note that you can configure IntelliJ IDEA to run an Ant task or a Maven goal either before or after the main project compilation, so if your build is doing something non-standard, you can still use it with the IntelliJ IDEA build system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With