1-and-1 :: FOSS Libraries useable by Apache Maven
-SNAPSHOT
is stripped to determine the release version, the last numeric part if this release version-SNAPSHOT
again to get the next development version.ono-maven-shared
offers some additional policies.release
you need to include this component as dependency like this:
<project>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<dependencies>
<dependency>
<groupId>net.oneandone.maven</groupId>
<artifactId>ono-maven-shared</artifactId>
<version>2.X</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
ONOArtifactoryVersionPolicy
MAJOR-SNAPSHOT
or MAJOR.MINOR-SNAPSHOT
and the next releaseMAJOR.MINOR
or MAJOR.MINOR.MICRO
, e.g. you already released 1.54
and the next version1.55
.releaseVersion
to the next number. The nextdevelopmentVersion
always stays the same until you change it yourself in the source. -DONOArtifactoryVersionPolicy.latest=LATEST_FOUND_RELEASE
and as of 2.5 -DONOCurrentVersion=LATEST_FOUND_RELEASE
.artifactory-version-policy-server-id
which is used for~/.m2/settings.xml
. This only works with plain text orLatest deployed release is always 1.5.6
Development Version | Version of Next Release |
---|---|
1-SNAPSHOT | 1.5.7 |
1.0-SNAPSHOT | 1.5.7 |
1.5.6-SNAPSHOT | 1.5.7 |
1.5.7-SNAPSHOT | 1.5.7 |
1.6-SNAPSHOT | 1.6.0 |
2-SNAPSHOT | 2.0 |
2.0-SNAPSHOT | 2.0.0 |
When no version of the Artifact could be found, the latest version is always 0.
Development Version | Version of Next Release | Latest Version |
---|---|---|
1.6-SNAPSHOT | 1.6.0 | 0 |
2-SNAPSHOT | 2.0 | 0 |
2.0-SNAPSHOT | 2.0.0 | 0 |
dependency
to maven-release-plugin
.projectVersionPolicyId
to ONOArtifactoryVersionPolicy
.artifactory-version-policy-http
: Base-URL of Artifactory (without trailing slash, defaults to http://repo.jfrog.org/artifactory) artifactory-version-policy-repositories
: Comma separated list of repositories to search (defaults to: repo1)
<project>
<properties>
<projectVersionPolicyId>ONOArtifactoryVersionPolicy</projectVersionPolicyId>
<!-- for inhouse repositories -->
<artifactory-version-policy-http>http://artifactory.example.com/artifactory</artifactory-version-policy-http>
<!-- for inhouse repositories -->
<artifactory-version-policy-repositories>first-repo,second-repo</artifactory-version-policy-repositories>
</properties>
<!-- do not forget to include ono-maven-shared as dependency as stated above -->
</project>
ONOBuildNumberVersionPolicy
MAJOR-SNAPSHOT
or MAJOR.MINOR-SNAPSHOT
and the next releaseMAJOR.MINOR
or MAJOR.MINOR.MICRO
and you want to use the BUILD_NUMBER
availableBUILD_NUMBER
as MINOR
or MICRO
version. The nextdevelopmentVersion
always stays the same until you change it yourself in the source. dependency
to maven-release-plugin
.projectVersionPolicyId
to ONOBuildNumberVersionPolicy
.<buildnumber-version-policy-identifier>
when the environment name of your build number isTRAVIS_BUILD_NUMBER
.
<project>
<properties>
<projectVersionPolicyId>ONOBuildNumberVersionPolicy</projectVersionPolicyId>
<buildnumber-version-policy-identifier>TRAVIS_BUILD_NUMBER</buildnumber-version-policy-identifier>
</properties>
<!-- do not forget to include ono-maven-shared as dependency as stated above -->
</project>
ONOChangesVersionPolicy
src/changes/changes.xml
as leading document while releasing.src/changes/changes.xml
will be used as releaseVersion
.-DONOCurrentVersion=LATEST_FOUND_RELEASE
.developmentVersion
always stays the same until you change it yourself in the source.dependency
to maven-release-plugin
.projectVersionPolicyId
to ONOChangesVersionPolicy
.
<project>
<properties>
<projectVersionPolicyId>ONOChangesVersionPolicy</projectVersionPolicyId>
</properties>
<!-- do not forget to include ono-maven-shared as dependency as stated above -->
</project>
developmentVersion
- for maven-release-plugin
releaseVersion
- for maven-release-plugin
newVersion
- for versions-maven-plugin
ONOCurrentVersion
- for maven-changes-plugin
tag
- for maven-scm-plugin
changes.version
- for maven-changes-plugin
maven-release-plugin
.mvn ono-maven-shared:changes-version versions:set deploy -DperformRelease=true