Skip to content

Instantly share code, notes, and snippets.

@weikangchia
Created August 8, 2021 13:26
Show Gist options
  • Save weikangchia/5bebf7c94aee618483d7253ff388286d to your computer and use it in GitHub Desktop.
Save weikangchia/5bebf7c94aee618483d7253ff388286d to your computer and use it in GitHub Desktop.
<profiles>
<profile>
<id>bump-patch</id>
<activation>
<property>
<name>bumpPatch</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set</goal>
</goals>
<phase>validate</phase>
<configuration>
<newVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}</newVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>bump-minor</id>
<activation>
<property>
<name>bumpMinor</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set</goal>
</goals>
<phase>validate</phase>
<configuration>
<newVersion>${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0</newVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>bump-major</id>
<activation>
<property>
<name>bumpMajor</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set</goal>
</goals>
<phase>validate</phase>
<configuration>
<newVersion>${parsedVersion.nextMajorVersion}.0.0</newVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment