I just added wrapped Maven (https://github.com/takari/maven-wrapper) to my Maven project, and I'm wondering if there's a way to configure IntelliJ IDEA (at project level) to use wrapped Maven (./mvnw
) instead of looking at Maven Home.
mvnw: it's an executable Unix shell script used in place of a fully installed Maven. mvnw. cmd: it's the Batch version of the above script. mvn: the hidden folder that holds the Maven Wrapper Java library and its properties file.
From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. In the list that opens, select Run Maven Goal. In the Select Maven Goal dialog, specify a project and a goal that you want to execute before launching the project. Click OK.
In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.
Click Run -> Edit Configurations -> Press + -> Search for "Maven" -> Locate "Command Line" field and enter in following maven commands "clean install" -> Press OK. Now click the green button to run that Run/Debug Configuration, this will maven clean install the module/project.
There's no official support for Maven Wrapper yet, but the third-party plugin "Maven Wrapper support" by Stephan Pauxberger works for me:
https://plugins.jetbrains.com/plugin/10633-maven-wrapper-support
I use it with IDEA 2018.3.
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