Maven

Skip to end of metadata
Go to start of metadata

Maven 2

Minimal Maven pom

  • Sometimes it is necessary to create a pom file for a dependency.
  • The minimum requirement for a pom is:

Public Maven 2 repos

http://repo1.maven.org/maven2/
http://repo2.maven.org/maven2/
http://download.java.net/maven/2/
http://mirrors.ibiblio.org/pub/mirrors/maven2/

https://nexus.codehaus.org/
https://repository.jboss.org/nexus/

http://caucho.com/m2/
http://caucho.com/m2-snapshot/

Adding addition repos

  • Edit the pom.xml and add the following after the build element:

Using the archetype plugin

  • Setting up a project can take a bit of time, using archetypes can shorten it.
  • Using the archetype:generate goal will display archetypes and prompt the user to choose one.
  • Reference:
    http://maven.apache.org/plugins/maven-archetype-plugin/generate-mojo.html

Tomcat maven plugins

  • Edit the $CATALINA_HOME/conf/tomcat-users.xml and add a user:
  • There are 3 different plugins for tomcat:
    • tomcat-maven-plugin from org.codehaus.mojo (tomcat 6, stable)
    • tomcat6-maven-plugin from org.apache.tomcat.maven (tomcat 6, stabilizing)
    • tomcat7-maven-plugin from org.apache.tomcat.maven (tomcat 7, stabilizing)

tomcat-maven-plugin

  • Add this to the pom.xml:

tomcat6-maven-plugin

  • Add this to the pom.xml:

tomcat7-maven-plugin

Jetty maven plugin

  • Add this to the pom.xml:

Downloading of source and javadoc archives

Override artifact name

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.