Maven release for Git

詹高畅
2023-12-01
1. Update pom.xml file with below
<scm>
  <connection>scm:git:ssh://<User ID>@<Server Address>:<Port>/<Project Name></connection>
  <url>scm:git:ssh://<User ID>@<Server Address>:<Port>/<Project Name></url>
  <developerConnection>scm:git:ssh://<User ID>@<Server Address>:<Port>/<Project Name></developerConnection>
</scm>

2. Add Maven plugin in pom.xml file
<build>
      <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <version>2.1</version>
          </plugin>
      </plugins>
</build>

3. Execute command
Command: mvn release:clean release:prepare -Dtag=<New Tag> -DdevelopmentVersion=<development version> -DreleaseVersion=<Release Version>
Example: mvn release:clean release:prepare -Dtag=steven -DdevelopmentVersion=3.8-SNAPSHOT -DreleaseVersion=3.9

developmentVersion: Default version to use for new local working copy.
releaseVersion: Default version to use when preparing a release or a branch.
 类似资料:

相关阅读

相关文章

相关问答