Maven: Difference between revisions

From Wiki RB4
Line 3: Line 3:
Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:
Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:


    Builds
#Builds
    Documentation
#Documentation
    Reporting
#Reporting
    Dependencies
#Dependencies
    SCMs
#SCMs
    Releases
#Releases
    Distribution
#Distribution


Maven beinhaltet als wichtiges Konzept genau definierte Build '''Lifecycles'''. Die drei Standard-Lifecycle sind: clean, default und site.
Maven beinhaltet als wichtiges Konzept genau definierte Build '''Lifecycles'''. Die drei Standard-Lifecycle sind: clean, default und site.

Revision as of 21:52, 7 January 2012

Introduction

Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:

  1. Builds
  2. Documentation
  3. Reporting
  4. Dependencies
  5. SCMs
  6. Releases
  7. Distribution

Maven beinhaltet als wichtiges Konzept genau definierte Build Lifecycles. Die drei Standard-Lifecycle sind: clean, default und site. Build Lifecycles bestehen aus Lifecycle-Phasen. Wichtige Phasen sind beispielsweise: clean, compile, test, package, integration-test, verify, install, deploy und site. In den Lifecycle-Phasen werden jeweils bestimmte Plugin-Goals ausgeführt. Maven-Plugins sind Bibliotheken, die thematisch zusammengehörende Goals implementieren. Wichtige Plugins sind zum Beispiel: archetype, compiler, surefire, jar, war, install, deploy, site, dependency, eclipse und jetty. Goals können bestimmten Lifecycle-Phasen zugeordnet werden und werden dann automatisch zum richtigen Zeitpunkt aufgerufen (z.B. "compiler:compile"). Maven-Goals sind vergleichbar mit Ant-Tasks.

Ein Maven-Archetype ist ein Projekt-Template. Über das archetype-Plugin können Standard-Directory-Layouts und Projektvorlagen für verschiedene Projekttypen erstellt werden (z.B. quickstart, webapp und mojo). Dabei wird auch eine vorläufige pom.xml angelegt.

Artefakt sind im Zusammenhang mit Maven Arbeitsergebnisse gemeint. Maven-Projekte haben in der Regel ein Hauptergebnis-Artefakt, oft eine jar-, war- oder ear-Datei. Mit Koordinaten werden die fünf ein Artefakt identifizierenden Informationsbestandteile bezeichnet. Oft sind vor allem die drei wichtigsten gemeint: groupId, artifactId und version.

Installation

Configuration

All information is stored in pom.xml.

Operation

mvn <cmd> -Dverbose
mvn clean
mvn compile
mvn test  // delete all artefacts and target dir
mvn package // build artefacts

Resources