Java Reference
In-Depth Information
This is the build descriptor for our project. It starts with a global <project> tag with
the appropriate namespaces, inside which we place all of our components:
modelVersion —The model version of the pom being used. Currently the only
supported version is 4.0.0.
groupId —The group ID of our project. Notice that this is the value that we pro-
vided on the command line when invoking Maven. The groupId acts as the Java
packaging in the filesystem; it groups together different projects from one orga-
nization, company, group of people, and so on.
artifactId —The artifact ID of our project. Again, the value here is the one we
specified on the command line. The artifactId represents the name the proj-
ect is known by.
packaging —What kind of artifact packaging will our project use? We specify
here jar , but it also could be pom , ear , or war .
version —The current version of our project (or our project's artifact). Notice
the -SNAPSHOT ending. This ending denotes that this artifact is still in develop-
ment mode; we haven't released it yet.
dependencies —This section is used to list the dependencies.
Now that we have our project descriptor, let's improve it a little, as shown in listing 10.5.
First, we need to change the version of the JU nit dependency, because we're using 4.6,
and the one that the plug-in generated is 3.8.1. After that, we can make some additional
information in the pom.xml more descriptive, like adding a developers section. This
information not only makes the pom.xml more descriptive, but it will also be included
later on when we build the website.
Listing 10.5
Additional metadata for the pom.xml
<developers>
<developer>
<name>Petar Tahchiev</name>
<id>ptahchiev</id>
<organization>Apache Software Foundation</organization>
<roles>
<role>Java Developer</role>
</roles>
</developer>
<developer>
<name>Gary Gregory</name>
<id>ggregory</id>
<organization>Apache Software Foundation</organization>
<roles>
<role>Java Developer</role>
</roles>
</developer>
<developer>
<name>Felipe Leme</name>
<id>felipeal</id>
<organization>Apache Software Foundation</organization>
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search