Controlling the constraints
One of the requirements for a build tool is to be able to generate repeatable builds. In a project, the build tool should behave identically for all team members. While a project guideline can be made on the version of Java or Maven to be used, it would be easier if it could be enforced automatically.
This is where the Maven Enforcer plugin comes in.
How to do it...
- Open a simple project (
project-with-enforcer
). - Add the following plugin configuration:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <id>enforce-versions</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <requireMavenVersion> ...