I've been trying to figure this out for a few days now, I have looked all over stackoverflow and none of the answers fix my issue. I am trying to have the <version>
in my Pom.xml.
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>maven.Test</groupId>
<artifactId>Hello</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<distributionManagement>
<repository>
<id>Artifactory</id>
<name>Artifactory-releases</name>
<url>${publish.location}</url>
</repository>
<snapshotRepository>
<id>Artifactory</id>
<name>Artifactory-snapshots</name>
<url>${publish.location}</url>
</snapshotRepository>
</distributionManagement>
</project>
I am using Maven 3.3.3 currently, I have looked into SCM plugins but those don't seem to be working. I know you can have it increment versions by setting them as variables but that isn't ideal for my developers. When a build is run using the command mvn deploy
I want the version to auto increment to 1.0.1 and so on.
EDIT:
I tried doing the maven release but am running into an issue which may be on me. For the release plugin are there edits I need to make to my Pom.xml? I ran mvn release:prepare
but ran into this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3
.2:prepare (default-cli) on project Hello: Unable to check for local modificatio
ns
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] 'svn' is not recognized as an internal or external command,
[ERROR] operable program or batch file.
If you want to upgrade to a newer version of Maven, you need to download it from Maven's site, or use a package manager such as apt , or whatever your distribution uses. If you would like to migrate your projects from Maven 2.
The Versions Plugin is used when you want to manage the versions of artifacts in a project's POM.
release:perform will fork a new Maven instance to build the checked-out project. This new Maven instance will use the same system configuration and Maven profiles used by the one running the release:perform goal.
Picking up @rec's answer:
Use:
$ mvn -B release:prepare release:perform
Note the -B
. It will run in batch mode and the release plugin won't ask at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With