Skip to content

Commit

Permalink
chore: add pom version check ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Dec 15, 2023
1 parent 229ce6e commit a7e634b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<!--
official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
add maven-enforce-plugin to make sure the right jdk is used
add maven-enforcer-plugin to make sure the right jdk is used
https://stackoverflow.com/a/18420462/922688
-->
<plugin>
Expand All @@ -309,6 +309,23 @@
</rules>
</configuration>
</execution>
<execution>
<id>enforce-property</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- https://maven.apache.org/enforcer/enforcer-rules/requireProperty.html -->
<requireProperty>
<property>project.version</property>
<regex>^\d\.\d+\.\d+(-(Alpha|Beta|RC)\d+)?$|^\d(\.\d+)?\.(\d+|x)-SNAPSHOT$</regex>
<regexMessage>"Project version(${project.version}) format is invalid!"</regexMessage>
</requireProperty>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down

0 comments on commit a7e634b

Please sign in to comment.