Skip to content

Commit

Permalink
Dynamically generate plugin version
Browse files Browse the repository at this point in the history
(cherry picked from commit 44defd2)
  • Loading branch information
NeumimTo committed Oct 29, 2017
1 parent afeda98 commit 9a36a93
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
8 changes: 8 additions & 0 deletions Plugin/src/main/java-templates/cz/neumimto/rpg/Version.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cz.neumimto.rpg;

/**
* Created by NeumimTo on 29.10.2017.
*/
public class Version {
public static final String VERSION = "${project.version}";
}
2 changes: 1 addition & 1 deletion Plugin/src/main/java/cz/neumimto/rpg/NtRpgPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
/**
* Created by NeumimTo on 29.4.2015.
*/
@Plugin(id = "nt-rpg", version = "1.0.8", name = "NT-Rpg", dependencies = {
@Plugin(id = "nt-rpg", version = Version.VERSION, name = "NT-Rpg", dependencies = {
@Dependency(id = "nt-core", version = "1.9", optional = false)
})
public class NtRpgPlugin {
Expand Down
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
</repository>
</repositories>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>filter-src</id>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down

0 comments on commit 9a36a93

Please sign in to comment.