What does Maven have to do with Project Health
In the introduction, it was pointed out that Maven’s application of patterns provides visibility and comprehensibility. It is these characteristics that assist you in assessing the health of your project.
Through the POM, Maven has access to the information that makes up a project, and using a variety of tools, Maven can analyze, relate, and display that information in a single place. Because the POM is a declarative model of the project, new tools that can assess its health are easily integrated. In this chapter, you’ll learn how to use a number of these tools effectively.
When referring to health, there are two aspects to consider:
- Code quality – determining how well the code works, how well it is tested, and how well it adapts to change.
- Project vitality – finding out whether there is any activity on the project, and what the nature of that activity is.
Maven takes all of the information you need to know about your project and brings it together under the project Web site. The next three sections demonstrate how to set up an effective project Web site.
It is important not to get carried away with setting up a fancy Web site full of reports that nobody will ever use (especially when reports contain failures they don’t want to know about!). For this reason, many of the reports illustrated can be run as part of the regular build in the form of a “check” that will fail the build if a certain condition is not met.
But, why have a site, if the build fails its checks? The Web site also provides a permanent record of a project’s health, which everyone can see at any time. It provides additional information to help determine the reasons for a failed build, and whether the conditions for the checks are set correctly. This is important, because if the bar is set too high, there will be too many failed builds. This is unproductive as minor changes are prioritized over more important tasks, to get a build to pass. Conversely, if the bar is set too low, the project will meet only the lowest standard and go no further.
In this chapter, you will be revisiting the Proficio application that was developed in Chapter 3, and learning more about the health of the project. The code that concluded Chapter 3 is also included in Code_Ch06.zip for convenience as a starting point. To begin, unzip the Code_Ch06.zip file into C:mvnbook or your selected working directory, and then run mvn install from the proficio subdirectory to ensure everything is in place.