Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: Build > Rebuild Project menu item versus Maven clean install

For a Maven-driven project in IntelliJ 2018, when should I choose to use…

  • The IntelliJ 2018.1 menu item Build > Rebuild Project
  • The Maven panel’s clean and install Lifecycle items

Under what circumstances is either appropriate?

My situation is a Vaadin 8 application using the vaadin-archetype-application-multimodule Vaadin archetype.

The Question, Does IntelliJ Build > Rebuild Project invoke maven? has a single Answer that says the Rebuild Project does not invoke Maven at all. But no guidance is given on when to use route versus the other.

like image 801
Basil Bourque Avatar asked Nov 08 '22 07:11

Basil Bourque


1 Answers

Well, if you make substancial changes within a pom.xml file (new plugins, new modules within a multi-module project), you'd better run "mvn clean install". I personally never use the "Rebuild Project" within a Maven project. usually I just "make" the project so the class files are updated, or I start a real Maven build to get new / updated dependencies.

The third important option (for me) is the "Reimport all Maven projects" option, which is quite useful if a pure Maven build runs fine, but IntelliJ still thinks that there is something wrong within your project.

like image 180
Marcus K. Avatar answered Nov 15 '22 07:11

Marcus K.