auto build number

This commit is contained in:
Gabriele C 2015-11-26 19:20:14 +01:00
parent 1b30139ded
commit db67c77b33
3 changed files with 52 additions and 5 deletions

50
pom.xml
View File

@ -52,7 +52,8 @@
<!-- Project Properties -->
<pluginName>AuthMe</pluginName>
<mainClass>fr.xephi.authme.AuthMe</mainClass>
<pluginAuthors>[Xephi, sgdc3, DNx5, timvisee, games647, ljacqu]</pluginAuthors>
<buildNumber>-1</buildNumber>
<pluginAuthors>Xephi, sgdc3, DNx5, timvisee, games647, ljacqu</pluginAuthors>
<!-- Change Compiler Version (JDK) HERE! -->
<javaVersion>1.7</javaVersion>
@ -61,6 +62,20 @@
<bukkitVersion>1.8.8-R0.1-SNAPSHOT</bukkitVersion>
</properties>
<profiles>
<profile>
<id>jenkins</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<properties>
<buildNumber>${env.BUILD_NUMBER}</buildNumber>
</properties>
</profile>
</profiles>
<build>
<finalName>AuthMe-${project.version}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
@ -112,6 +127,39 @@
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>/target/**/AuthMe.java</include>
</includes>
<replacements>
<replacement>
<token>>UNKNOWNVERSION</token>
<value>${project.version}</value>
</replacement>
<replacement>
<token>>BUILDNUMBER</token>
<value>${buildNumber}</value>
</replacement>
<replacement>
<token>>PLUGINAUTHORS</token>
<value>${pluginAuthors}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- TODO: we need also to relocate the other libs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -62,12 +62,11 @@ public class AuthMe extends JavaPlugin {
/**
* Defines the current AuthMeReloaded version name.
*/
private static final String PLUGIN_VERSION_NAME = "5.1-SNAPSHOT";
private static final String PLUGIN_VERSION_NAME = ">VERSION";
/**
* Defines the current AuthMeReloaded version code.
*/
// TODO: Increase this number by one when an update is release
private static final int PLUGIN_VERSION_CODE = 100;
private static final int PLUGIN_VERSION_CODE = Integer.parseInt(">BUILDNUMBER");
private static AuthMe plugin;
private static Server server;

View File

@ -1,5 +1,5 @@
name: ${pluginName}
authors: ${pluginAuthors}
authors: [${pluginAuthors}]
website: ${project.url}
description: ${project.description}
main: ${mainClass}