Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How create maven alias for set of goals

Tags:

java

maven

build

I'm configuring a maven project and I want to create alias for set of goals. example: mvn server - to execute mvn clean package tomcat:run

Grunt task runner do it very well, but I haven't found a way to do the same in maven.

like image 749
diogo beato Avatar asked Sep 06 '15 15:09

diogo beato


1 Answers

You can define a <defaultGoal>...</defaultGoal> in your pom if you like. So you can define something like this:

<project>
  <build>
    <defaultGoal>clean package tomcat:run</defaultGoal>
    .
  </build>
</project>

will be activated if you simply call mvn...not really an alias, cause usually you don't need one...

like image 181
khmarbaise Avatar answered Sep 28 '22 17:09

khmarbaise