Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use IntelliJ bundled maven in terminal?

Using MacOS Catalina. Installed IntelliJ. Maven works fine but in terminal mvn comand is not found. How to use IntelliJs maven in terminal?

like image 418
user415612 Avatar asked Jan 28 '20 06:01

user415612


People also ask

How do I run Maven commands in IntelliJ terminal?

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 you run Mvn clean install in IntelliJ terminal?

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

In my case, I added the following 2 commands to ~/.zshrc (which is what I am using)

export PATH="/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin:$PATH"

# Otherwise we get a "permission denied"
chmod +x "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn"

Now, I can call mvn from the terminal.

like image 154
nbro Avatar answered Oct 19 '22 04:10

nbro