Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a list of available goals?

Tags:

maven-2

I'm rather new to Maven and I often find myself wanting to see what's actually there in terms of goals.

So, is there a command which lists all available goals for e.g. a given prefix?

like image 285
Matthias Avatar asked Nov 04 '09 15:11

Matthias


People also ask

What should I write in goals when maven builds?

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.

What is maven validate?

validate is the first phase of the default maven build life cycle which is not attached to any of the maven goals/plugin by default.


1 Answers

Since Maven is an open system of plugins, the best answer is probably "Google" ;-). If you mean all build lifecycle phases, they are static, and can be found at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html and at other places.

Then, for a given plugin, the help plugin can be used to get the possible goals and all their parameters:

mvn help:describe -DgroupId=org.apache.maven.plugins \                   -DartifactId=maven-war-plugin \                   -Ddetail=true 

But this doesn't really answer your question, especially the "for a given prefix" part. For this, the best solution might be to use **auto completion with BASH (**not sure it will be exhaustive though). See for example the Guide to Maven 2.x auto completion using BASH. To get bash completion working under Windows, you'll need CYGWIN. See Maven Tab Auto Completion in Bash for detailed setup steps (and a "better" working auto completion script).

like image 139
Pascal Thivent Avatar answered Sep 17 '22 13:09

Pascal Thivent