2015-11-27 15:41:21 +00:00
|
|
|
KEMITIX-PARENT
|
|
|
|
==============
|
|
|
|
|
|
|
|
This Maven Parent POM several preconfigured plugins.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
#### Maven
|
|
|
|
|
|
|
|
<parent>
|
|
|
|
<groupId>net.kemitix</groupId>
|
|
|
|
<artifactId>kemitix-parent</artifactId>
|
2016-08-16 20:23:51 +01:00
|
|
|
<version>RELEASE</version>
|
2015-11-27 15:41:21 +00:00
|
|
|
</parent>
|
|
|
|
|
2016-08-16 20:24:20 +01:00
|
|
|
## Versions
|
|
|
|
|
|
|
|
If you want to override the version or configuration values of any of the
|
|
|
|
plugins configured by this parent, you can set the following properties to the
|
|
|
|
desired value.
|
|
|
|
|
2017-04-30 08:13:02 +01:00
|
|
|
* project.build.sourceEncoding
|
|
|
|
* project.reporting.outputEncoding
|
|
|
|
* kemitix.build.directory
|
|
|
|
* kemitix-checkstyle-ruleset.version
|
|
|
|
* kemitix-checkstyle-ruleset.level
|
|
|
|
* lombok.version
|
|
|
|
* digraph-dependency.version
|
|
|
|
* digraph-dependency.basePackage
|
|
|
|
* maven-javadoc-plugin.version
|
|
|
|
* maven-source-plugin.version
|
|
|
|
* maven-gpg-plugin.version
|
|
|
|
* maven-deploy-plugin.version
|
|
|
|
* maven-compiler-plugin.version
|
|
|
|
* maven-surefire-plugin.version
|
|
|
|
* maven-failsafe-plugin.version
|
|
|
|
* maven-pmd-plugin.version
|
|
|
|
* huntbugs.version
|
|
|
|
* jacoco-maven-plugin.version
|
|
|
|
* highwheel-maven.version
|
2017-05-30 21:22:27 +01:00
|
|
|
* pitest.version
|
2017-04-30 08:13:02 +01:00
|
|
|
* maven-jxr-plugin.version
|
|
|
|
* jacoco-class-line-covered-ratio
|
|
|
|
* jacoco-class-instruction-covered-ratio
|
|
|
|
* jacoco-class-missed-count-maximum
|
|
|
|
* java.version
|
2016-08-16 20:24:20 +01:00
|
|
|
|
2017-01-18 12:04:44 +00:00
|
|
|
## Checkstyle
|
2015-11-27 15:41:21 +00:00
|
|
|
|
2017-01-18 12:04:44 +00:00
|
|
|
The Checkstyle plugin is configured using the
|
|
|
|
`kemitix-checkstyle-ruleset-maven-plugin`.
|
2015-11-27 15:41:21 +00:00
|
|
|
|
2017-01-18 12:04:44 +00:00
|
|
|
The `kemitix-checkstyle-ruleset` provides five levels of checks. The
|
2017-02-08 12:41:17 +00:00
|
|
|
default is set to `5-complexity`, the most strict. It runs during the
|
|
|
|
`validate` phase.
|
2015-11-27 15:41:21 +00:00
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
2017-01-18 12:04:44 +00:00
|
|
|
Set the property `kemitix-checkstyle-ruleset.level` to one of the
|
|
|
|
following values to select a less-strict ruleset:
|
2015-11-27 15:41:21 +00:00
|
|
|
|
2017-01-18 12:04:44 +00:00
|
|
|
* 1-layout
|
|
|
|
* 2-naming
|
|
|
|
* 3-javadoc
|
|
|
|
* 4-tweaks
|
|
|
|
* 5-complexity
|
2015-11-27 15:41:21 +00:00
|
|
|
|
|
|
|
## Maven Compiler Plugin
|
|
|
|
|
|
|
|
The [Maven Compiler Plugin](https://maven.apache.org/plugins/maven-compiler-plugin/)
|
|
|
|
compiles your sources.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
Ref: [compile:compile](https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html)
|
|
|
|
|
|
|
|
* showDeprecation: true
|
|
|
|
* showWarnings: true
|
|
|
|
* source: 1.8
|
|
|
|
* target: 1.8
|
|
|
|
|
|
|
|
## Maven Surefire Plugin
|
|
|
|
|
|
|
|
The [Maven Surefire Plugin](http://maven.apache.org/surefire/maven-surefire-plugin/index.html)
|
|
|
|
runs your Unit Tests.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Maven Failsafe Plugin
|
|
|
|
|
|
|
|
The [Maven Failsafe Plugin](http://maven.apache.org/surefire/maven-failsafe-plugin/index.html)
|
|
|
|
runs your Integration Tests.
|
|
|
|
|
|
|
|
Runs its [integration-test](http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html)
|
|
|
|
goal during the `verify` phase.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Maven PMD Plugin
|
|
|
|
|
|
|
|
The [Maven PMD Plugin](https://maven.apache.org/plugins/maven-pmd-plugin/index.html)
|
|
|
|
runs the [PMD](http://pmd.sourceforge.net/) code analysis.
|
|
|
|
|
|
|
|
Runs its [pmd](https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html)
|
|
|
|
and [cpd](https://maven.apache.org/plugins/maven-pmd-plugin/cpd-mojo.html) goals
|
2017-01-18 12:05:55 +00:00
|
|
|
during the `compile` phase.
|
2015-11-27 15:41:21 +00:00
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
2017-01-18 11:59:27 +00:00
|
|
|
## Huntbugs Maven Plugin
|
2015-11-27 15:41:21 +00:00
|
|
|
|
2017-01-18 11:59:27 +00:00
|
|
|
The [Huntbugs Maven Plugin](https://github.com/amaembo/huntbugs) is a
|
|
|
|
static code analyser.
|
2015-11-27 15:41:21 +00:00
|
|
|
|
2017-01-18 11:59:27 +00:00
|
|
|
Runs during the `compile` phase.
|
2015-11-27 15:41:21 +00:00
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Jacoco Maven Plugin
|
|
|
|
|
|
|
|
The [Jacoco Maven Plugin](http://eclemma.org/jacoco/trunk/doc/maven.html)
|
|
|
|
provides code coverage analysis after your tests have run.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
#### Classes
|
|
|
|
|
|
|
|
For each class not excluded the Lines Covered Ratio must be at least 50%.
|
|
|
|
|
|
|
|
For each class not excluded the Instructions Covered Ration must be at least
|
|
|
|
80%.
|
|
|
|
|
|
|
|
Excluded from analysis:
|
|
|
|
|
|
|
|
* `*Test` - test classes
|
2017-01-18 12:05:55 +00:00
|
|
|
* `*IT` - integration test classes
|
|
|
|
* `*Main` - main classes
|
|
|
|
* `*Application` - application classes
|
|
|
|
* `*Configuration` - (Spring) configuration classes
|
2015-11-27 15:41:21 +00:00
|
|
|
|
|
|
|
## Maven Source Plugin
|
|
|
|
|
|
|
|
The [Maven Source Plugin](https://maven.apache.org/plugins/maven-source-plugin/)
|
|
|
|
bundles your sources into a jar file ready for deployment.
|
|
|
|
|
2017-01-18 12:05:55 +00:00
|
|
|
Runs its [jar-no-fork](https://maven.apache.org/plugins/maven-source-plugin/jar-no-fork-mojo.html)
|
2015-11-27 15:41:21 +00:00
|
|
|
goal during the `verify` phase.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Maven Javadoc Plugin
|
|
|
|
|
|
|
|
The [Maven Javadoc Plugin](https://maven.apache.org/plugins/maven-javadoc-plugin/)
|
|
|
|
generates your html javadocs and bundles them into a jar file ready for
|
|
|
|
deployment.
|
|
|
|
|
2017-01-18 12:05:55 +00:00
|
|
|
Runs its [jar](https://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html)
|
2015-11-27 15:41:21 +00:00
|
|
|
goal during the `verify` phase.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Maven Deploy Plugin
|
|
|
|
|
|
|
|
The [Maven Deploy Plugin](https://maven.apache.org/plugins/maven-deploy-plugin/)
|
|
|
|
uploads your artifacts to a remote repository.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
|
|
|
## Maven JXR Plugin
|
|
|
|
|
|
|
|
The [Maven JXR Plugin](http://maven.apache.org/jxr/maven-jxr-plugin/index.html)
|
|
|
|
produces cross-referenced HTML pages of your source code.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
No configuration applied beyond the defaults.
|
|
|
|
|
2016-01-04 12:44:08 +00:00
|
|
|
## Highwheel Plugin
|
|
|
|
|
|
|
|
The [Highwheel Plugin](https://github.com/hcoles/highwheel)
|
|
|
|
generates a report for packages and classes at `target/highwheel/index.html`
|
|
|
|
that highlights where there are cyclic dependencies between packages and between
|
|
|
|
classes.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
2017-05-30 21:22:27 +01:00
|
|
|
The plugin will `analyse` the project during the `verify` phase.
|
|
|
|
|
|
|
|
## Pitest Plugin
|
|
|
|
|
|
|
|
The [Pitest Plugin](http://pitest.org/)
|
|
|
|
provides mutation testing for classes found in the generated `target`
|
|
|
|
directory.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
The plugin with perform mutation tests during the `verify` phase.
|
|
|
|
|
|
|
|
By default, classed named `Immutable*`, will not be included.
|
|
|
|
(e.g. classes generated by `org.immutables:value`)
|
|
|
|
|
|
|
|
The following properties can adjust the default configuration.
|
|
|
|
|
|
|
|
#### `pitest.skip`
|
|
|
|
|
|
|
|
Default is `false`.
|
|
|
|
|
|
|
|
Set this to `true` to disable the **Pitest Plugin**.
|
|
|
|
|
|
|
|
#### `pitest.coverage`
|
|
|
|
|
|
|
|
Default is `0`%. (i.e. disabled)
|
|
|
|
|
|
|
|
Line coverage at which to fail build.
|
|
|
|
|
|
|
|
#### `pitest.mutation`
|
|
|
|
|
|
|
|
Default is `0`%. (i.e. disabled)
|
|
|
|
|
|
|
|
Mutation score threshold at which to fail build.
|
|
|
|
|
|
|
|
#### `pitest.failWhenNoMutations`
|
|
|
|
|
|
|
|
Default is `true`.
|
|
|
|
|
|
|
|
Set this to `false` to not fail build when there are no mutations.
|
2016-01-04 12:44:08 +00:00
|
|
|
|
2016-01-07 12:45:50 +00:00
|
|
|
## Digraph Dependency Plugin
|
|
|
|
|
|
|
|
The [Digraph Dependency Plugin](https://github.com/kemitix/digraph-dependency-maven-plugin)
|
|
|
|
generates a DOT file diagram showing the dependencies between packages in a project.
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
2017-01-18 12:01:16 +00:00
|
|
|
The plugin will generate the `target/digraph.dot` file during the `validate` phase.
|
2016-01-07 12:45:50 +00:00
|
|
|
|
2017-01-18 12:01:16 +00:00
|
|
|
Set the `digraph-dependency.basePackage` property to the root package to graph.
|
2016-01-07 12:45:50 +00:00
|
|
|
|
2015-11-27 15:41:21 +00:00
|
|
|
# Distribution Management
|
|
|
|
|
|
|
|
Remote repositories are provided for the Sonatype Nexus Snapshots and Nexus Release
|
|
|
|
Repositories. See the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html)
|
|
|
|
for information on how to deploy your artifact the Maven Central through
|
|
|
|
Sonatype.
|
2016-02-09 16:40:31 +00:00
|
|
|
|
|
|
|
### Changing the Build Directory
|
|
|
|
|
|
|
|
If you want to change the build directory, e.g. from your settings.xml to an SSD
|
|
|
|
or ram drive, then set the value of the `kemitix.build.directory` to your required
|
|
|
|
locations. e.g.
|
|
|
|
`<properties>
|
|
|
|
<kemitix.build.directory>/mnt/ramdrive/${project.groupId}/${project.artifactId}</kemitix.build.directory>
|
|
|
|
</properties>`
|