Java Reference
In-Depth Information
Figure 10.2
Maven produces nice website documentation for the project.
This website is generated in Maven's build directory—another convention. Maven
uses the target/ directory for all the needs of the build itself. The convention contin-
ues even beneath this directory: source code is compiled in the target/classes/ direc-
tory, and the documentation is generated in target/site/.
After you examine the project, you'll probably notice that this website is more like
a skeleton of a website. That's true, but remember that we entered only a small
amount of data to begin with. We could enter more data and web pages in the src/site
directory, and Maven will include it in the website, generating full documentation.
10.3
Introduction to Maven plug-ins
So far, so good. You've seen what Maven is and how to use it to start a project from
scratch. You've also seen how to generate the project's documentation and how to
import our project in Eclipse.
To continue, we can get the source code from the first part of the topic and place
it in the src/main/java directory, where Maven expects it to be. Also, we can get the
tests for the sampling project and place them in the src/test/java directory (again a
convention). Now it's time to invoke Maven and instruct it to compile the source code
and tests and also to execute the tests.
But first we need to clean the project from our previous activities:
mvn clean
 
 
 
 
Search WWH ::




Custom Search