Skip to content

Commit

Permalink
chore(ci): add bytecode version verification plugin (#590)
Browse files Browse the repository at this point in the history
Co-authored-by: Jerry Lee <[email protected]>
  • Loading branch information
wuwen5 and oldratlee committed Dec 21, 2023
1 parent cbc0f64 commit efc5d4d
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven</id>
<id>enforces</id>
<goals>
<goal>enforce</goal>
</goals>
Expand Down Expand Up @@ -830,7 +830,7 @@
</build>
</profile>
<profile>
<id>force-jdk11-when-release</id>
<id>enforce-when-release</id>
<activation>
<property>
<name>performRelease</name>
Expand All @@ -839,44 +839,43 @@
</activation>
<build>
<plugins>
<!--
add maven-enforcer-plugin to make sure the right jdk is used
https://stackoverflow.com/a/18420462/922688
-->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-jdk-versions</id>
<id>enforces</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!--
add maven-enforcer-plugin to make sure the right jdk is used
https://stackoverflow.com/a/18420462/922688
-->
<requireJavaVersion>
<version>17</version>
</requireJavaVersion>
</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>
<enforceBytecodeVersion>
<maxJdkVersion>${maven.compiler.source}</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit efc5d4d

Please sign in to comment.