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

    • Tharindu: i started blogging long long time back but couldnt continue. last november i stated blogging again with...
    • maria: maybe he didnt believe in god, i dont either and does it really matter?? his message is the same:he talks...
    • Cliffano Subagio: Sure thing. The license for the images is Creative Commons Attribution Share Alike...
    • daniel: nice articles. can I copy your images? :D
    • Cliffano Subagio: Only an idea, won’t be made into real site (unless someone else wants to do it). Something...

    Most Commented Posts

    Linkroll