Appendix E. Java7developer—the Maven POM
This appendix covers sections of the pom.xml file that builds the java7developer project discussed in chapter 12. This appendix expands on the contents of the important parts of the pom.xml file, so you can understand the full build. Basic project information (section 12.1) and profiles (listing 12.4) are covered adequately in chapter 12, so we’ll look at these two sections of the POM here:
- The build configuration
- The dependencies
We’ll begin with the longest section, the build configuration.
The build section contains the plugins and their configuration, which you need in order to execute the Maven build lifecycle goals. For many projects, this section is quite small, because the default plugins at their default settings are usually adequate. But for the java7developer project, the <build> section contains several plugins that override some of the defaults. We do this so that the java7developer project can
- Build the Java 7 code
- Build the Scala and Groovy code
- Run Java, Scala, and Groovy tests
- Provide Checkstyle and FindBugs code metric reports
If you need to configure further aspects of your build, you can check out the full list of plugins at http://maven.apache.org/plugins/index.html.
The following code listing shows the build configuration for the java7-developer project.
