Java Reference
In-Depth Information
<roles>
<role>Java Developer</role>
</roles>
</developer>
</developers>
Listing 10.6 continues the previous one, showing the organization , description ,
and inceptionYear elements.
Listing 10.6
Description elements for the pom.xml
<description>
"JUnit in Action II" book, the sample project for the "Running Junit
tests from Maven" chapter.
</description>
<organization>
<name>Manning Publications</name>
<url> http://manning.com/</url>
</organization>
<inceptionYear>2008</inceptionYear>
Now let's move on and start developing our software. We want to use our favorite Java
IDE : Eclipse or IntelliJ IDEA . No problem—Maven offers additional plug-ins to import
the project into our favorite IDE . For instance, we use Eclipse to show you how this
import happens. Again, open a terminal and navigate to the directory that contains
your project descriptor (pom.xml). Once there, type the following and hit Enter:
mvn eclipse:eclipse -DdownloadSources=true
This will invoke the maven-eclipse-plugin , which, after downloading the necessary
artifacts, will produce the two files (.project and .classpath) that Eclipse needs in
order to recognize your project as an Eclipse project. The downloadSources parame-
ter that we specify in the command line is optional. By using it we instruct the plug-in
to also download source attachments. You can also download the Javadoc attachments
by setting the optional downloadJavadocs parameter to true on the command line.
Now you can import your project into Eclipse and examine it; you'll notice that all of
the dependencies that are listed in the pom.xml file are now added to your build-
path . Amazing, isn't it?
To continue, let's generate some documentation for the project. But wait a sec-
ond, how are we supposed to do that? We don't have any files to generate the docu-
mentation from. This is another one of Maven's great features—with the little
configuration and description that we have, we can produce a fully functional website
skeleton. Type
mvn site
on the command line where your pom.xml is. Maven should start downloading its
plug-ins, and after their successful installation, it will produce the nice website you see
in figure 10.2.
 
 
 
 
 
Search WWH ::




Custom Search