Maven parent POM for generating build reports for CI servers, pushing artifacts to Sonatype OSSRH and site documentation to GitHub
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
CHANGELOG.md
LICENSE
README.md
pom.xml

README.md

Build Reports

In effort to keep the actual Maven project's pom.xml concise and clean, this parent POM generates various build reports for Maven site and Continuous Integration Servers (Jenkins, SonarQube, etc).

Compatible with Java 7 and 8.

Tested on Jenkins 1.645 and Sonar 5.3.

This parent POM also includes a profile that allows you to push:-

How to Use

Add the following configuration to your project's pom.xml:-

<project ...>
    <parent>
        <groupId>com.github.choonchernlim</groupId>
        <artifactId>build-reports</artifactId>
        <version>0.3.2</version>
    </parent>

    ...
</project>

Jenkins Integration

mvn clean test site

SonarQube Integration

Create a Maven profile, for example:-

<profiles>
    <profile>
        <id>sonarqube</id>
        <properties>
            <sonar.host.url>...</sonar.host.url>
            <sonar.sources>src/main/java</sonar.sources>
            <sonar.tests>src/test/java</sonar.tests>
            <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
            <sonar.junit.reportsPath>${project.build.directory}/surefire-reports</sonar.junit.reportsPath>
            <sonar.jacoco.reportPath>${jacoco.reportPath}</sonar.jacoco.reportPath>
            <sonar.jacoco.itReportPath>${jacoco.itReportPath}</sonar.jacoco.itReportPath>
        </properties>
    </profile>
</profiles>

Run the following goals and profile:-

mvn clean test sonar:sonar -Psonarqube

Deploy to Sonatype OSSRH

mvn clean deploy -Possrh-deploy

Deploy Site to GitHub

mvn clean test site -Possrh-deploy

Important Notes

Build Plugins

Profile: "ossrh-deploy"