Search code examples
javamavenintellij-ideanetbeansbuild

How to clean or clean build my Maven project in IntelliJ IDEA?


I'm using Apache Maven in my Java project. in NetBeans there are build and clean build icons but there aren't in IntellIJ IDEA. How can I clean or clean build my project in it?


Solution

  • The answer here with the most votes suggests running the clean and install Lifecycle items separately in IntelliJ, which is easy enough and works. But it’s worth mentioning that you can combine these steps (and/or others) by instead creating a new Run/Debug Configuration of type maven and adding the command clean install (or whichever combination of maven lifecycle methods you run on a recurring basis).

    Thereafter, running a mvn clean install is as simple as clicking the green button to run that Run/Debug Configuration.

    enter image description here