27 Jul 2006, 11:53am
Projects:
by Cliffano Subagio

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

    • Chess Strategizer: This just got bookmarked! “That’s why I always think of Simon Bolivar and remember that...
    • David from getcheaptrainfares.co.uk: Thank you very much for sharing your wonderful tips! That would definitely be a...
    • Natasha: The quote “Find the best in everybody. Just keep waiting no matter how long it takes. No one is all...
    • Alfonzo Donkin: Stumbled upon your website via bing the other day and absolutely think its great. Carry on the great...
    • Cliffano Subagio: Sure thing.

    Most Commented Posts

    Linkroll