imgen
imgen

Reputation: 3133

How to run custom maven goal inside Intellij IDEA?

When deploy, my command line "mvn tomcat7:deploy" instead of just "mvn deploy", is there a way to let the Maven Projects view to run the desired command line when I click deploy?

Upvotes: 2

Views: 3292

Answers (1)

Bastien Jansen
Bastien Jansen

Reputation: 8846

If you double click on deploy in the "Maven Projects" view, it will not launch any application server, but deploy maven artifacts on a remote server (for example a Nexus instance).

If the tomcat maven plugin is correctly configured in your pom.xml, you should expand the Plugins node under your Maven module (still in the "Maven Projects" view), expand the tomcat7 node then double click the tomcat7:deploy goal.

As a second option, you could also create a new Maven run/debug configuration and specify your own goals, this is very useful if you have to provide additional parameters such as -PmyProfile.

Upvotes: 2

Related Questions