Topics Map > Sample Documents

Sample: Doc 14925 - Wiki page: Maven Information

Include your own introductory text here Donec fermentum ut orci non posuere. Mauris euismod volutpat nisl nec molestie. Proin porta cursus leo ultrices pharetra. Nunc eu mauris turpis. Nulla eu turpis imperdiet magna auctor luctus non vel mi. Proin quis arcu odio. Mauris auctor ipsum nisi, ultrices rutrum erat pulvinar non. Vivamus ultricies, urna sed pretium interdum, arcu orci accumsan mauris, at sodales nisl tortor vitae lectus. Nunc eu justo egestas, venenatis quam nec, mollis neque. Mauris nunc tellus, scelerisque a dictum quis, vulputate viverra dui.Please refer to Maven details below.




Maven 2 Cheat Sheet

To create a standard Java project:

mvn archetype:create -DgroupId=<group-id> -DartifactId=<artifact-id>

To create a Web application:

mvn archetype:create -DgroupId=<group-id> -DartifactId=<artifact-id> \
-DarchetypeVersion=1.0-alpha-4 -Dpackagename=<package> \
-Dpackaging=war -DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-webapp

To install a dependency to your repository:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

Example: Install the uPortal API Abstraction Layer into J2EE Dev local repository
mvn install:install-file -Dfile=PortalAPIAbstractionLayer.jar -DgroupId=edu.wisc.my.apilayer -DartifactId=PortalAPIAbstractionLayer -Dversion=1.0 -Dpackaging=jar 

Turn a Maven project directory into an Eclipse workspace:

mvn -Declipse.workspace=/Users/mgs/Desktop/Eclipse/workspace eclipse:add-maven-repo
mvn eclipse:eclipse

Useful links: Apache Maven Project Maven POM Reference

Better Builds with Maven (see the "Attachments" tab for accompanying sample code and errata)



Keywords:
Doc ID:
36833
Owned by:
Leah S. in KB User's Guide
Created:
2014-01-28
Updated:
2021-06-01
Sites:
KB User's Guide