<project xmlns="http://maven.apache.org/POM/4.0.0" |
the POM is an XML file, with a namespace |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
the namespace for XML schemata |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
schemaLocation makes it possible for XML editors to download the schema for a namespace from
an URL |
<modelversion>4.0.0</modelversion> |
POM's have a version, so that maven can check whether the used version of the
program can cope with the syntax of the POM |
<groupid>be.peopleware.training.maven</groupid> |
artifacts are gathered in groups, to avoid naming conflicts; also used as package name by archetype :-( |
<artifactid>helloWorld</artifactid> |
the name of the artifact to be created in this project |
<packaging>jar</packaging> |
the type of the artifact to be created; this defines what to do exactly during the build |
<version>1.0-SNAPSHOT</version> |
the version of the artifact we are currently working on; SNAPSHOT means we are
working toward version 1.0, but we are not ready to release yet |
<name>Maven Quick Start Archetype</name> |
the human-readable name of the artifact to be created (change this) |
<url>http://maven.apache.org</url> |
the URL where information about this project can be found (change this) |
<dependencies> |
the list of other artifacts this project depends on; they will be downloaded as needed from a remote repository
(change this) |
<dependency> |
this project depends on JUnit |
<groupid>junit</groupid> |
the JUnit artifact is stored in group junit |
<artifactid>junit</artifactid> |
the JUnit artifact is called junit |
<version>3.8.1</version> |
we want version 3.8.1 of JUnit |
<scope>test</scope> |
we only need JUnit during test of our project |
</dependency>
</dependencies>
</project> |
|
helloWorld/
|-- pom.xml
|-- src/
| |-- … |
|
`-- target/ |
generated material (things not to put under version control: add to .cvsignore/.svnignore/…) |
|-- classes/
| `-- be/
| `-- peopleware/
| `-- training/
| `-- maven/
| `-- App.class |
result of compilation of main Java source and copy of main resources |
|-- exported-pom.xml |
consolidated POM (there is more than what we saw earlier; have a look) |
|-- helloWorld-1.0-SNAPSHOT.jar |
the created artifact; note the compound name artifactId-version.jar |
|-- surefire-reports/ |
test reports |
| |-- TEST-be.peopleware.training.maven.AppTest.xml |
XML version of test report |
| `-- be.peopleware.training.maven.AppTest.txt |
text version of test report |
`-- test-classes/
`-- be/
`-- peopleware/
`-- training/
`-- maven/
`-- AppTest.class |
result of compilation of test Java source and copy of test resources |
helloWorld-1.0-SNAPSHOT.jar/
|-- META-INF/ |
|
| |-- MANIFEST.MF |
maven generate a manifest (have a look); maven has put the version information and
other build information here |
| `-- maven/ |
maven information is also meta-information |
| `-- be.peopleware.training.maven/
| `-- helloWorld/ |
there is room for meta-information on several maven projects here |
| |-- pom.properties |
meta-information on the POM (meta-meta-information) |
| `-- pom.xml |
the exported (consolidated) POM |
`-- be/
`-- peopleware/
`-- training/
`-- maven/
`-- App.class |
|