You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by bd...@apache.org on 2022/12/20 20:34:54 UTC

[directory-scimple] 01/01: Add enforcer rule to ensure dependencies have compatible bytecode versions

This is an automated email from the ASF dual-hosted git repository.

bdemers pushed a commit to branch ensure-bytecode-version
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git

commit 0cc5e9c7f18d4050daa0cbd70e53c2dadd5797a6
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Dec 20 15:34:43 2022 -0500

    Add enforcer rule to ensure dependencies have compatible bytecode versions
    
    All non-spring modules require Java 11 (Spring modules Java 17)
---
 pom.xml                                            | 22 ++++++++++++++++++++++
 scim-coverage/pom.xml                              | 18 +++++-------------
 .../scim-server-spring-boot/pom.xml                |  1 +
 support/spring-boot/pom.xml                        |  1 +
 4 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3f739879..d0bee39a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,6 +34,7 @@
 
   <properties>
     <jdk.version>11</jdk.version>
+    <max.jdk.version>${jdk.version}</max.jdk.version>
     <maven.compiler.source>${jdk.version}</maven.compiler.source>
     <maven.compiler.target>${jdk.version}</maven.compiler.target>
     <maven.compiler.release>${jdk.version}</maven.compiler.release>
@@ -379,6 +380,13 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>3.1.0</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>extra-enforcer-rules</artifactId>
+            <version>1.6.1</version>
+          </dependency>
+        </dependencies>
         <executions>
           <execution>
             <id>enforce-java</id>
@@ -393,6 +401,20 @@
               </rules>
             </configuration>
           </execution>
+          <execution>
+            <id>enforce-bytecode-version</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <enforceBytecodeVersion>
+                  <maxJdkVersion>${max.jdk.version}</maxJdkVersion>
+                </enforceBytecodeVersion>
+              </rules>
+              <fail>true</fail>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/scim-coverage/pom.xml b/scim-coverage/pom.xml
index 090e2564..9fcf9bc8 100644
--- a/scim-coverage/pom.xml
+++ b/scim-coverage/pom.xml
@@ -28,6 +28,11 @@
   <name>SCIM - Total Test Coverage</name>
   <packaging>pom</packaging>
 
+  <properties>
+    <!-- The spring modules require 17 -->
+    <max.jdk.version>17</max.jdk.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.scim</groupId>
@@ -76,17 +81,4 @@
       </plugin>
     </plugins>
   </build>
-
-  <profiles>
-    <profile>
-      <id>spring-boot</id>
-      <dependencies>
-        <dependency>
-          <groupId>org.apache.directory.scim</groupId>
-          <artifactId>scim-spring-boot-starter</artifactId>
-        </dependency>
-      </dependencies>
-    </profile>
-  </profiles>
-
 </project>
diff --git a/scim-server-examples/scim-server-spring-boot/pom.xml b/scim-server-examples/scim-server-spring-boot/pom.xml
index 30d9d103..e8765e41 100644
--- a/scim-server-examples/scim-server-spring-boot/pom.xml
+++ b/scim-server-examples/scim-server-spring-boot/pom.xml
@@ -29,6 +29,7 @@
 
   <properties>
     <module.name>org.apache.directory.scim.example.springboot</module.name>
+    <max.jdk.version>17</max.jdk.version>
   </properties>
 
   <dependencyManagement>
diff --git a/support/spring-boot/pom.xml b/support/spring-boot/pom.xml
index 9f1bf170..771070c6 100644
--- a/support/spring-boot/pom.xml
+++ b/support/spring-boot/pom.xml
@@ -30,6 +30,7 @@
 
   <properties>
     <module.name>org.apache.directory.scim.spring</module.name>
+    <max.jdk.version>17</max.jdk.version>
   </properties>
 
   <dependencyManagement>