https://github.com/digipost/digipost-open-super-pom
Super pom for Digipost open source projects
https://github.com/digipost/digipost-open-super-pom
Last synced: about 2 months ago
JSON representation
Super pom for Digipost open source projects
- Host: GitHub
- URL: https://github.com/digipost/digipost-open-super-pom
- Owner: digipost
- License: apache-2.0
- Created: 2011-10-06T06:34:35.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2023-03-14T09:09:02.000Z (about 2 years ago)
- Last Synced: 2025-01-29T05:37:54.137Z (4 months ago)
- Homepage: https://api.digipost.no/
- Size: 51.8 KB
- Stars: 2
- Watchers: 26
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://maven-badges.herokuapp.com/maven-central/no.digipost/digipost-open-super-pom)
# Digipost Open Source Project – Super-POM
Common configuration for
[Digipost open source projects](https://github.com/digipost). It enables deployment to
[Sonatype's staging and snapshot repository](https://oss.sonatype.org), and provides
some configuration of commonly used plugins.## Usage
Add the following parent to your POM file:
```xml
no.digipost
digipost-open-super-pom
12```
## Build source and javadoc artifacts
Using this POM as parent will ensure that proper artifacts are built containing source files and
javadoc during release, which is required to be allowed to publish to the Maven Central Repository.
This is not enabled for snapshot builds by default, but can be enabled by using the profile
`build-sources-and-javadoc`. If you want this to be enabled for all your builds, you can create
the file `.mvn/maven.config` in your project with the following content:```
-P build-sources-and-javadoc
```## Analyze declared dependencies vs. actually used
You can enable the profile `dependency-analyze` to include maven-dependency-plugin in your
build, configured to check if your declared dependencies match with what is actually used.Add profile (or append separated with a `,`) in `.mvn/maven.config`:
```
-P dependency-analyze
```## Check license headers in source files
Add the contents you would like to use as a license header in your source files
to the file `src/main/license-header.txt` (e.g. [this](examples/license-header.txt)),
and enable the profile `check-license-header` in your build.Add profile (or append separated with a `,`) in `.mvn/maven.config`:
```
-P check-license-header
```You can also add additional excludes by configuring the license-maven-plugin
in ``:
```xmlcom.mycila
license-maven-plugin
src/somthing/*.*
something/**/*
```
## Generate and check NOTICE file
Add the template you would like to use for a
[NOTICE](https://www.apache.org/licenses/LICENSE-2.0.html#redistribution) file
to be included in the repository to `src/NOTICE.template`. E.g. [this](examples/NOTICE.template).Add the profile `include-NOTICE` (or append separated with `,`) in `.mvn/maven.config`:
```
-P include-NOTICE
```Generate NOTICE file with the command `mvn notice:generate` (this should be committed
to the repository). The build will include `notice:check` which validates that the
NOTICE file is up to date according to dependencies of the project.## Generate report on API changes
This POM contains base config for [japicmp-maven-plugin](https://siom79.github.io/japicmp/) which can be used to
generate a report showing API changes and how you should version a new release. This config is not active by default,
but contained in the profile named `japicmp`, and you may want to complement the config by specifying which package
to include in the report in ``:```xml
com.github.siom79.japicmp
japicmp-maven-plugin
no.digipost.signature
```
The report can be generated using the command:
```sh
mvn -Pjapicmp -Dproject.previousVersion=X.Y
```
(replace `X.Y` with the actual version you want to compare with)## Release artifacts
With this parent pom you can now release to Sonatype nexus with automatic close and release from staging
repository. This eliminates the need to manually logging in and click close and release.To perform a release you need to set a version in the project. Either you use set it or if you have
multiple modules, you can use `mvn versions:set -DnewVersion=$RELEASE_VERSION`.If you commit that change or not, that is up to you. We will in the future skip that commit.
You can then perform the release: `mvn clean deploy --activate-profiles build-sources-and-javadoc,sign-artifacts,release`
## License
Projects are released under [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt), unless stated otherwise by an individual project.