MAVEN HOWTO

Maven ist das Build Tool für die meisten OpenSource Projekte bei aixcept. Alle erzeugten Release Artefakte der Projekte werden in einem eigenen Maven Repository publiziert. Wenn Sie die aktuellste Developer Version eines Artefaktes benötigen, so können Sie dieses im Snapshot Repository finden.

Weitere Information zur Nutzung von Maven können auf der Maven Homepage gefunden werden. Dabei sind besonders die Abschnitte zur Dokumentation und zu den einzelnen Plugins interessant.

Nützliche Kommandos

Nachfolgend eine Liste der allgemein genutzten Maven Kommandos.

mvn clean Deletes all files in target directory or directories (for multi-module projects)
mvn compile Compile the project
mvn jetty:run-war Packages and deploys your application to Jetty, reachable at http://localhost:8080
mvn war:inplace tomcat:inplace Deploying the in-place WAR directory: Tomcat needs to be up and running for this goal
mvn cargo:start -Dcargo.wait=true Packages and deploys your application to active Cargo profile (Tomcat 5.5.x by default), reachable at http://localhost:8080/yourapp-version
mvn test Runs all tests in src/test/java. Use "-Dtest=ClassName" (not fully-qualified) to run individual tests
mvn install -Dmaven.test.skip=true Skipping Tests
mvn package Creates a WAR or JAR depending on your project type
mvn integration-test Runs UI tests in Tomcat using Cargo
mvn install Installs generated artifacts in your local repository
mvn deploy Deploy the JAR (and other) artifacts to the repository
mvn site Creates project site and reports
mvn site-deploy Generate and deploy the site

Hilfreiche Properties

-Dmaven.test.skip Do not execute the unit tests
-Dmaven.test.failure.ignore Continue even if the unit tests have failed

Hilfreiche Parameter

mvn -U Check for updates for all snapshot releases
mvn -up Check for updates for the plugins
mvn -o Work offline
mvn --help See full llist of optional commands

Kommandos zur IDE Konfiguration

mvn eclipse:eclipse Create an Eclipse project
mvn eclipse:clean Remove the Eclipse project
mvn idea:idea Create an IntelliJ IDEA project
mvn idea:clean Remove the IntelliJ IDEA project

Nützliche Maven Plugins

Es werden eine Reihe von Maven Plugins innerhalb der Projekte genutzt, die den Entwicklungsprozess vereinfachen.

  • Cargo Maven Plugin
    Used to start and stop containers before and after running integration tests (i.e. with Canoo WebTest or Selenium).
  • DbUnit Maven Plugin
    This plugin is a wrapper around DbUnit and is used to populate the database with sample data before running tests.
  • Hibernate3 Maven Plugin
    Used to create the database schema when using Hibernate or JPA for the DAO framework.
  • Maven Jetty Plugin
    Used to run an embedded Jetty instance from Maven.
  • Native2Ascii Maven Plugin
    Converts i18n bundles from native to ascii format.
  • Tomcat Maven Plugin
    Similar to the Maven Jetty Plugin - can start an embedded Tomcat instance to deploy your project or manage a remote instance.