Base POM

DevOps By Rultor.com

License

Build Status Dependency Status

Issue Stats Issue Stats

GitHub release Maven Central

Overview

Base Maven projects on this artifact and you will get many pre-configuration benefits, including up-to-date dependencies, plugins, build extensions, repositories, and more.

Get it now

All that you need to do is to define our artifact as a parent of your project:

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.maxur</groupId>
    <artifactId>maxur-base</artifactId>
    <version>1.01</version>
  </parent>
  <groupId>your-group-id</groupId>
  <artifactId>your-artifact-id</artifactId>
  <version>1.2.3-SNAPSHOT</version>
  [...]
</project>

Properties

Name Description Value Default Value
env Target environment dev, qa, prod dev
project.root For multi-module projects it is the root project path path .
site.path Path to Project Site’s sources path .
project.jdk The version of JDK. java version 1.8
snapshot.allowed.artifacts List of dependency patterns to exclude when checking for snapshot versions list of patterns org.maxur:*

Profiles

announcement

The profile is activated automatically when you have the target environment as production.

$ mvn clean install -Denv=prod

Generate an announcement from the announcement template

gh-pages

This profile can be activated manually:

$ mvn clean install -Pgh-pages

You can deploy site without SSH key by OAuth Token.

settings.xml

<server>
    <id>github</id>
    <password>OAuthToken</password>
</server>

It configures site deployment to github pages. See http://pages.github.com/

gpg

Sign artifacts before installation with GPG. To enable this profile you should have “gpg.keyname” property defined.

maven-gpg-plugin used to GPG-sign the artifact before deployment to foreign repository. GPG keys have to be provided in CI environment, and published beforehand.
http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/

inspect

The profile is activated automatically when you have the target environment as qa. This profile can be activated manually:

$ mvn clean install -Pinspect

It runs a number of checks to make sure the quality of the build is acceptable.

These plugins are used at the moment to control quality and prevent errors

maven-duplicate-finder-plugin is a filter of duplicate classes and resources in classpath. It helps to identify dependencies that are not used, or the ones that are used but not defined.

maven-checkstyle-plugin generates a report regarding the code style used by the developers. For more information about Checkstyle, see http://checkstyle.sourceforge.net/

All plugins are bound to the verify Maven phase. All executions are named maxur-check.

kotlin

This profile can be activated manually:

It configures kotlin dependencies

jacoco

This profile can be activated manually:

It configures jacoco-maven-plugin for check and report tests coverage.

Name Description Value Default Value
unit.tests.coverage.output.directory The path to unit tests coverage report path ${project.reporting.outputDirectory}/jacoco-ut
integration.tests.coverage.output.directory The path to integration tests coverage report path ${project.reporting.outputDirectory}/jacoco-it

site

The profile builds site for production environment.

sonar

The profile is activated automatically when you have a sonar.properties file in a root directory.

sonar.properties

sonar.sourceEncoding = UTF-8
sonar.language = java

sonar.host.url = http://192.168.1.1:9000
sonar.jdbc.url = jdbc:postgresql://192.168.1.1:5432/sonar
sonar.jdbc.driverClassName = org.postgresql.Driver
sonar.jdbc.username = sonar
sonar.jdbc.password = sonar

sonar.forceAnalysis = true

sonar.artifact.path=

It configures sonar-maven-plugin.

sonatype

The profile deploys all artifacts to oss.sonatype.org repository . It also skips default deployment plugin.

versioneye

The maven plugin for VersionEye helps you to create/update a project at VersionEye, which is a Notification System for Software Libraries. It will help you to keep your projects up-to-date and automatically notify you about outdated dependencies and license violations. You can check it out here: www.versioneye.com.

The profile is activated when you have src/qa/resources/versioneye.properties file in the project.

versioneye.properties

api_key = YOUR_SECRET_API_KEY
project_id = YOUR_VERSONEYE_PROJECT_ID

see versioneye_maven_plugin for more details

Implicit Profiles

check-dep

Switch on 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 standard rules and user created rules.

dep-spock

Enable unit testing. The profile is activated when you have src/test/groovy directory in the project. These artifacts are automatically added to the list of dependencies (in test scope):

dep-junit

Enable unit testing. The profile is activated when you have src/test/java directory in the project. These artifacts are automatically added to the list of dependencies (in test scope, of course):

dep-log4j

Enable LOG4J2 for logging and SLF4J binding. The profile is activated when you have src/test/resources/log4j2.xml.

dep-logback

Enable logback for logging and SLF4J binding. The profile is activated when you have src/test/resources/logback-test.xml.