Add build number to plugin version on development builds

This commit is contained in:
filoghost 2020-04-25 11:28:01 +02:00
parent cc50c426f6
commit e882a4d73e
2 changed files with 31 additions and 1 deletions

View File

@ -168,6 +168,33 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!-- Appends build number to plugin version on SNAPSHOT builds. -->
<execution>
<id>set-plugin-version</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<property environment="env" />
<condition property="project.pluginVersion" value="${project.version}-b${env.BUILD_NUMBER}" else="${project.version}">
<and>
<isset property="env.BUILD_NUMBER" />
<contains string="${project.version}" substring="SNAPSHOT" />
</and>
</condition>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@ -177,6 +204,9 @@
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${project.pluginVersion}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>

View File

@ -1,7 +1,7 @@
name: HolographicDisplays
main: com.gmail.filoghost.holographicdisplays.HolographicDisplays
author: filoghost
version: ${project.version}
version: ${project.pluginVersion}
api-version: 1.13
softdepend: [ProtocolLib]