27 Jul 2006, 11:53am
Projects:
by

2 comments

  • My Maven2 Cheat Sheet

    Here are some Maven2 command lines that I use most often:

    To create a new project:

    mvn archetype:create -DgroupId=com.mbledug.foo -DartifactId=bar

    To generate Eclipse project descriptor after configuring the dependencies in pom.xml:

    mvn eclipse:eclipse

    To run unit tests, obviously:

    mvn test

    Tun run a single test by test class name:

    mvn test -Dtest=FooBar

    To generate site documentation without running the tests (handy while updating the APTs):

    mvn -Dmaven.test.skip=true clean site

    To build the package file (jar, war, etc) allowing test failure:

    mvn -Dmaven.test.failure.ignore=true package

    To distribute the source code:

    mvn assembly:assembly -DdescriptorId=src

    To install a jar file on local repo:

    mvn install:install-file -Dfile=foo.jar -DgroupId=bar -Dversion=x.y -Dpackaging=jar -DartifactId=blah

    To release an artifact (create a tag in the SCM and bump up SNAPSHOT version in the pom):

    mvn release:prepare release:perform

     

    Recent Posts

    Recent Comments

    • Cliffano Subagio: Good to hear about your opportunity to visit Japan, I’m sure you will have a great...
    • Kayla: I’m going to Japan for two week this summer. Our sister city is Tsubame, Japan and my school has an...
    • poseidonfu: thanks,Very effective
    • anonymous: I really enjoyed both the last lecture and the book. I don’t think that theres anyone that I look up...
    • dioni: The thing I hate about HK is how people shove and push in the queue. Can’t they be civilized?!! I kept...

    Most Commented Posts

    Linkroll