From af402447b6018783c5f1b6fd576cd7a5c44e3154 Mon Sep 17 00:00:00 2001 From: filoghost Date: Sat, 22 Aug 2020 17:46:31 +0200 Subject: [PATCH] Use another method to add build number to plugin version --- plugin/pom.xml | 36 ++- plugin/src/main/resources/plugin.yml | 2 +- pom.xml | 420 +++++++++++++-------------- 3 files changed, 220 insertions(+), 238 deletions(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index 59d584d..2000575 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -72,27 +72,35 @@ - org.apache.maven.plugins - maven-antrun-plugin + org.codehaus.mojo + build-helper-maven-plugin set-plugin-version validate - run + bsh-property - true - - - - - - - - - + + pluginVersion + + + projectVersion = project.version; + buildNumber = System.getenv("BUILD_NUMBER"); + + String pluginVersion; + if (buildNumber != null @and projectVersion.contains("SNAPSHOT")) { + pluginVersion = projectVersion + "-b" + buildNumber; + } else { + pluginVersion = projectVersion; + } + + print("Project version: " + projectVersion); + print("Build number: " + buildNumber); + print("Computed plugin version: " + pluginVersion); + @@ -107,7 +115,7 @@ true - ${project.pluginVersion} + ${pluginVersion} diff --git a/plugin/src/main/resources/plugin.yml b/plugin/src/main/resources/plugin.yml index eb33aed..997ccea 100644 --- a/plugin/src/main/resources/plugin.yml +++ b/plugin/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ChestCommands main: me.filoghost.chestcommands.ChestCommands -version: ${project.pluginVersion} +version: ${pluginVersion} api-version: 1.13 softdepend: [Vault, BarAPI, PlaceholderAPI] diff --git a/pom.xml b/pom.xml index d6be06f..33680cb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,223 +1,197 @@ - - - 4.0.0 - - me.filoghost.chestcommands - chestcommands-parent - ChestCommands Parent - 4.0.0-SNAPSHOT - pom - - https://dev.bukkit.org/projects/chest-commands - - - GNU General Public License, Version 3 - https://www.gnu.org/licenses/gpl-3.0.txt - repo - - - - - https://github.com/filoghost/ChestCommands - scm:git:git://github.com:filoghost/ChestCommands.git - scm:git:git@github.com:filoghost/ChestCommands.git - - - - codemc-snapshots - https://repo.codemc.io/repository/maven-snapshots/ - - - codemc-releases - https://repo.codemc.io/repository/maven-releases/ - - - - - UTF-8 - 1.8 - 1.8 - true - - - - api - plugin - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - - vault-repo - http://nexus.hc.to/content/repositories/pub_releases - - - - confuser-repo - https://ci.frostcast.net/plugin/repository/everything/ - - - - codemc-repo - https://repo.codemc.io/repository/maven-public/ - - - - placeholderapi-repo - https://repo.extendedclip.com/content/repositories/placeholderapi/ - - - - - - - org.bukkit - bukkit - 1.8-R0.1-SNAPSHOT - provided - - - - net.milkbowl.vault - VaultAPI - 1.6 - provided - - - - me.confuser - BarAPI - 3.5 - provided - - - - me.clip - placeholderapi - 2.9.2 - provided - - - - org.bstats - bstats-bukkit-lite - 1.7 - - - - me.filoghost.updatechecker - updatechecker - 1.0.1 - - - - me.filoghost.fcommons - fcommons - 1.0.0 - - - - ${project.groupId} - chestcommands-api - ${project.version} - - - - - - clean package - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - false - - false - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.3 - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - - org.apache.maven.plugins - maven-antrun-plugin - 3.0.0 - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-antrun-plugin - [0.0,) - - run - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - - enforce - - - - - - [3.6.0,) - - - [1.8,) - - - - - - - - - - + + + 4.0.0 + + me.filoghost.chestcommands + chestcommands-parent + ChestCommands Parent + 4.0.0-SNAPSHOT + pom + + https://dev.bukkit.org/projects/chest-commands + + + GNU General Public License, Version 3 + https://www.gnu.org/licenses/gpl-3.0.txt + repo + + + + + https://github.com/filoghost/ChestCommands + scm:git:git://github.com:filoghost/ChestCommands.git + scm:git:git@github.com:filoghost/ChestCommands.git + + + + codemc-snapshots + https://repo.codemc.io/repository/maven-snapshots/ + + + codemc-releases + https://repo.codemc.io/repository/maven-releases/ + + + + + UTF-8 + 1.8 + 1.8 + true + + + + api + plugin + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + vault-repo + http://nexus.hc.to/content/repositories/pub_releases + + + + confuser-repo + https://ci.frostcast.net/plugin/repository/everything/ + + + + codemc-repo + https://repo.codemc.io/repository/maven-public/ + + + + placeholderapi-repo + https://repo.extendedclip.com/content/repositories/placeholderapi/ + + + + + + + org.bukkit + bukkit + 1.8-R0.1-SNAPSHOT + provided + + + + net.milkbowl.vault + VaultAPI + 1.6 + provided + + + + me.confuser + BarAPI + 3.5 + provided + + + + me.clip + placeholderapi + 2.9.2 + provided + + + + org.bstats + bstats-bukkit-lite + 1.7 + + + + me.filoghost.updatechecker + updatechecker + 1.0.1 + + + + me.filoghost.fcommons + fcommons + 1.0.0 + + + + ${project.groupId} + chestcommands-api + ${project.version} + + + + + + clean package + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + false + + false + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + + enforce + + + + + + [3.6.0,) + + + [1.8,) + + + + + + + + + +