This repository contains project settings for my personal project (as found in the other repositories).
The root project can be used to define common properties such as:
- dependencies
- plugins
- default configuration for some known plugins
- Java 8 / 11 / LATEST configuration
The LATEST here means the latest JDK.
The project is also configuring Eclipse project using the eclipse-settings-maven-plugin.
The settings folder contains settings for:
These are copied by the eclipse-settings-maven-plugin during project (re)configuration.
A site can be produced: mvn site site:stage
However, the project must first be packaged in a separate step.
New version are manually created (no automated step, even if attempt were made as in v29
with GitHub Actions and Maven releases):
- Create a GPG key if needed: see Managing commit signature verification
- Configure your maven settings:
- The
publish.directory.releases
andpublish.directory.snapshots
must target a local directory, and use thefile://
URI pattern. - The
gpg.keyname
andgpg.passphraseServerId
must be defined.
- The
This should give this settings.xml
:
<settings>
<servers>
<server> <id>gpg-github</id> <passphrase>foobar</passphrase> </server>
</servers>
<profiles>
<profile>
<id>project-settings</id>
<properties>
<publish.directory>file:///e:/git/github/glhez-maven-repository</publish.directory>
<publish.directory.releases>${publish.directory}/releases</publish.directory.releases>
<publish.directory.snapshots>${publish.directory}/snapshots</publish.directory.snapshots>
<publish.directory.site>${publish.directory}/site</publish.directory.site>
</properties>
</profile>
<profile>
<id>gpg-github</id>
<properties>
<gpg.keyname>YOUR_KEY</gpg.keyname>
<gpg.passphraseServerId>gpg-github</gpg.passphraseServerId>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>project-settings</activeProfile>
<activeProfile>gpg-github</activeProfile>
</activeProfiles>
</settings>
The maven-gpg-plugin must be configured with the following, otherwise the passphrase will be ignored:
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>`
Preparation
Simply invoke ./mvnw release:prepare release:perform
and pick up a new version.
Each project must define the following repositories:
- Plugin dependencies are fetched using
pluginRepository
rather thanrepository
. - Project should build without configuring further settings.
<repositories>
<repository>
<id>github-glhez-repo-dep</id>
<url>https://raw.githubusercontent.com/glhez/maven-repository/master/releases/</url>
<snapshots> <enabled>false</enabled> </snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>github-glhez-repo-plugin</id>
<url>https://raw.githubusercontent.com/glhez/maven-repository/master/releases/</url>
<snapshots> <enabled>false</enabled> </snapshots>
</pluginRepository>
</pluginRepositories>