List all of the possible goals in Maven 2?

前端 未结 6 1757
小蘑菇
小蘑菇 2020-12-22 18:13

I\'m new to Maven, coming from the Ant world.

Is it possible to list all of the possible goals (including, say, all the plugins) that you can run?

I can see

6条回答
  •  一个人的身影
    2020-12-22 18:37

    Is it possible to list all of the possible goals (including, say, all the plugins) that it is possible to run?

    Maven doesn't have anything built-in for that, although the list of phases is finite (the list of plugin goals isn't since the list of plugins isn't).

    But you can make things easier and leverage the power of bash completion (using cygwin if you're under Windows) as described in the Guide to Maven 2.x auto completion using BASH (but before to choose the script from this guide, read further).

    To get things working, first follow this guide to setup bash completion on your computer. Then, it's time to get a script for Maven2 and:

    • While you could use the one from the mini guide
    • While you use an improved version attached to MNG-3928
    • While you could use a random scripts found around the net (see the resources if you're curious)
    • I personally use the Bash Completion script from Ludovic Claude's PPA (which is bundled into the packaged version of maven in Ubuntu) that you can download from the HEAD. It's simply the best one.

    Below, here is what I get just to illustrate the result:

    $ mvn [tab][tab]
    Display all 377 possibilities? (y or n)
    ant:ant 
    ant:clean 
    ant:help 
    antrun:help 
    antrun:run 
    archetype:crawl 
    archetype:create 
    archetype:create-from-project 
    archetype:generate 
    archetype:help 
    assembly:assembly 
    assembly:directory 
    assembly:directory-single 
    assembly:help 
    assembly:single  
    ... 
    

    Of course, I never browse the 377 possibilities, I use completion. But this gives you an idea about the size of "a" list :)

    Resources

    • Guide to Maven 2.x auto completion using BASH
    • Fixing Maven 2.x BASH auto completion on CYGWIN
    • Maven bash completion
    • maven2 bash completion complete
    • Maven Tab Auto Completion in Bash
    • Advanced Bash completion script for Maven 2

提交回复
热议问题