The application is built with maven. The top level pom can be found in the project goedegep.toplevelpom. This pom file builds the complete application (all eclipse projects).
Things to know
- Default groupId for plugins
For plugins there is a default groupId: org.apache.maven.plugins
I make use of this default, so for plugins with this groupId I don’t specify the groupId.
Plugin information
maven-compiler-plugin
The Compiler Plugin is used to compile the sources of your project.
maven-enforcer-plugin
The Enforcer plugin provides goals to control certain environmental constraints such as Maven version, JDK version, and OS family along with many more built-in rules and user created rules.
maven-jar-plugin
This plugin provides the capability to build jars.
You don’t have to specify this plugin in your POM file, but it is good practice to do this, to specify the version to use.
maven-failsafe-plugin
The Failsafe Plugin is designed to run integration tests while the Surefire Plugin is designed to run unit tests.
As I don’t have any integration test, this plugin is not used.
maven-pmd-plugin
The PMD Plugin allows you to automatically run the PMD code analysis tool on your project’s source code and generate a site report with its results.
I don’t run this on the ‘Imported projects’, because I don’t make changes to these. To avoid running PMD on a project add the following to the POM file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.25.0</version>
<executions>
<execution>
<id>run-pmd</id>
<phase/>
</execution>
</executions>
</plugin>
maven-source-plugin
The Source Plugin creates a jar archive of the source files of the current project. The jar file is, by default, created in the project’s target directory.
I don’t have to create jar archives with source files, so this plugin is not used.
org.codehaus.mojo:versions-maven-plugin
This plugin provides information on versions. It is not used in normal builds, but run from time to time to check whether I use up to date versions of dependencies and plugins.
- mvn versions:display-dependency-updates
Provides information on newer versions of dependencies. - mvn versions:display-plugin-updates
Provides information on newer versions of plugins.
The latest version of a library can be found via Maven Central Repository Search, or on https://mvnrepository.com/.
maven-surefire-plugin
This plugin runs the tests.
Skip tests for included external projects
For external projects which I have included for learning and small changes, the tests are skipped.
To always skip the tests in a specific maven module use:
<project>
[...]
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
maven-resources-plugin
The Resources Plugin handles the copying of your project resources to the output directory.