Skip to content

Commit

Permalink
chore: add pom version check βœ…
Browse files Browse the repository at this point in the history
after released wrong pom version `v2.14.4` πŸ˜–

https://maven.apache.org/enforcer/enforcer-rules/requireProperty.html
  • Loading branch information
oldratlee committed Dec 10, 2023
1 parent 80cc6d2 commit 251f61c
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,6 @@
</plugin>
<!--
official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
add maven-enforce-plugin to make sure the right jdk is used
https://stackoverflow.com/a/18420462/922688
-->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down Expand Up @@ -850,7 +847,7 @@
<build>
<plugins>
<!--
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 @@ -869,6 +866,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 251f61c

Please sign in to comment.