Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ask IntelliJ to use wrapped maven (mvnw or mvnw.cmd)?

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.

like image 925
Jonathan Lermitage Avatar asked Jul 23 '17 20:07

Jonathan Lermitage


People also ask

What is MVNW and MVNW cmd?

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.

How do I run Maven commands in IntelliJ?

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.

How do I get Maven terminal in IntelliJ?

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.

Where is the run mvn clean install command in IntelliJ?

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.


1 Answers

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.

like image 68
seanf Avatar answered Oct 19 '22 08:10

seanf