Category Archives: maven

Maven : Creating simple project

  1. create a folder for the test project (D:\sandbox\junk)
  2. exceute the following from that folder
    • mvn archetype:create -DgroupId=sam.test -DartifactId=mvntest
    • Let it download some jar files
    • [INFO] Parameter: groupId, Value: sam.test
      [INFO] Parameter: packageName, Value: sam.test
      [INFO] Parameter: package, Value: sam.test
      [INFO] Parameter: artifactId, Value: mvntest
      [INFO] Parameter: basedir, Value: d:\SANDBOX\junk
      [INFO] Parameter: version, Value: 1.0-SNAPSHOT
      [INFO] project created from Old (1.x) Archetype in dir: d:\SANDBOX\junk\mvntest
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3 minutes 50 seconds
      [INFO] Finished at: Thu Mar 08 18:12:49 IST 2012
      [INFO] Final Memory: 12M/31M
      [INFO] ------------------------------------------------------------------------
    • pom.xml
      <project xmlns="" xmlns:xsi=""
  3. How to perform an archetype:create from Eclipse
  4. Importing Maven 2 project to Eclipse

Installing Maven

  1. Download Maven 2.2.1
  2. Unzip it to somewhere convenient (D:\TOOLS\apache-maven-2.2.1)
  3. Add M2_HOME system variable
    • Variable Name : M2_HOME
    • Variable Value : D:\TOOLS\apache-maven-2.2.1
  4. Modify Path variable, add %M2_HOME%\bin; at the end of the Variable value field
  5. To verify, open a CMD and type mvn -version