Skip to content

Commit 033c94b

Browse files
wuwen5oldratlee
andcommitted
chore(ci): add bytecode version verification plugin (#590)
Co-authored-by: Jerry Lee <[email protected]>
1 parent faf8e79 commit 033c94b

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

pom.xml

+17-18
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
<artifactId>maven-enforcer-plugin</artifactId>
410410
<executions>
411411
<execution>
412-
<id>enforce-maven</id>
412+
<id>enforces</id>
413413
<goals>
414414
<goal>enforce</goal>
415415
</goals>
@@ -830,7 +830,7 @@
830830
</build>
831831
</profile>
832832
<profile>
833-
<id>force-jdk11-when-release</id>
833+
<id>enforce-when-release</id>
834834
<activation>
835835
<property>
836836
<name>performRelease</name>
@@ -839,44 +839,43 @@
839839
</activation>
840840
<build>
841841
<plugins>
842-
<!--
843-
add maven-enforcer-plugin to make sure the right jdk is used
844-
https://stackoverflow.com/a/18420462/922688
845-
-->
846842
<plugin>
847843
<artifactId>maven-enforcer-plugin</artifactId>
848844
<executions>
849845
<execution>
850-
<id>enforce-jdk-versions</id>
846+
<id>enforces</id>
851847
<goals>
852848
<goal>enforce</goal>
853849
</goals>
854850
<configuration>
855851
<rules>
852+
<!--
853+
add maven-enforcer-plugin to make sure the right jdk is used
854+
https://stackoverflow.com/a/18420462/922688
855+
-->
856856
<requireJavaVersion>
857857
<version>17</version>
858858
</requireJavaVersion>
859-
</rules>
860-
</configuration>
861-
</execution>
862-
<execution>
863-
<id>enforce-property</id>
864-
<goals>
865-
<goal>enforce</goal>
866-
</goals>
867-
<configuration>
868-
<rules>
869859
<!-- https://maven.apache.org/enforcer/enforcer-rules/requireProperty.html -->
870860
<requireProperty>
871861
<property>project.version</property>
872862
<regex>^\d\.\d+\.\d+(-(Alpha|Beta|RC)\d+)?$|^\d(\.\d+)?\.(\d+|x)-SNAPSHOT$</regex>
873863
<regexMessage>"Project version(${project.version}) format is invalid!"</regexMessage>
874864
</requireProperty>
865+
<enforceBytecodeVersion>
866+
<maxJdkVersion>${maven.compiler.source}</maxJdkVersion>
867+
</enforceBytecodeVersion>
875868
</rules>
876-
<fail>true</fail>
877869
</configuration>
878870
</execution>
879871
</executions>
872+
<dependencies>
873+
<dependency>
874+
<groupId>org.codehaus.mojo</groupId>
875+
<artifactId>extra-enforcer-rules</artifactId>
876+
<version>1.7.0</version>
877+
</dependency>
878+
</dependencies>
880879
</plugin>
881880
</plugins>
882881
</build>

0 commit comments

Comments
 (0)