A parent pom for projects.
Determine the latest version of the parent pom in Maven Central.
Set the parent to your pom:
<parent>
<groupId>com.arpnetworking.build</groupId>
<artifactId>arpnetworking-parent-pom</artifactId>
<version>VERSION</version>
</parent>
The Maven Central repository is included by default.
The checkstyle configuration is obtained from the build-resources package. The checkstyle mojo is executed as part of the verify lifecycle. However, the mojo can also be executed directly. In order to execute the checkstyle mojo directly you need to also ensure the build-resources are extracted.
project> mvn dependency:unpack-dependencies checkstyle:check
The parent pom enables the use of Maven Wrapper in child projects and it also uses Maven Wrapper itself. In order to ensure consistent builds you should invoke mvnw instead of mvn to build the project locally and from continuous integration.
To allow developers to build wrapper and unwrapper projects seamlessly you can use this shell script to invoke either mvnw or mvn depending on which is available. Simply copy the script, make it executable and ensure it is first on PATH. Now continue to invoke mvn and it will actually run mvnw if available in the current project.
#!/bin/bash
# Look for maven wrapper
if [ -f "./mvnw" ]; then
echo "Maven wrapper found; invoking mvnw"
echo "./mvnw $@"
./mvnw "$@"
else
echo "Maven wrapper not found; invoking mvn"
/usr/local/bin/mvn "$@"
fi
Prerequisites:
Building:
arpnetworking-parent-pom> ./mvnw verify
To use the local version you must first install it locally:
arpnetworking-parent-pom> ./mvnw install
You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.
Published under Apache Software License 2.0, see LICENSE
© Arpnetworking Inc., 2015