]> source.dussan.org Git - archiva.git/commitdiff
fix upperbound and jdk 11 build
authorOlivier Lamy <olamy@apache.org>
Sun, 5 Jun 2022 23:46:02 +0000 (09:46 +1000)
committerOlivier Lamy <olamy@apache.org>
Sun, 5 Jun 2022 23:46:02 +0000 (09:46 +1000)
Signed-off-by: Olivier Lamy <olamy@apache.org>
15 files changed:
archiva-modules/archiva-base/archiva-checksum/pom.xml
archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java
archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
archiva-modules/archiva-base/archiva-policies/pom.xml
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-transaction/pom.xml
archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml
archiva-modules/archiva-maven/archiva-maven-repository/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-web-common/pom.xml
archiva-modules/plugins/problem-reports/pom.xml
pom.xml

index f376623a3b6ca5cff188cdb2cd6a488a75131c0b..bd8c9c89d94516cf13c9717f73e60fd7a834c52c 100644 (file)
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
 
   </dependencies>
 
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
+          <artifactId>jakarta.annotation-api</artifactId>
           <scope>test</scope>
         </dependency>
 
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
index d32e5fb5e2e2018e42aa56dc0da23c05f2e0af54..5c9e2f0fae1fb14da84897c4df0719aaa7a56743 100644 (file)
@@ -19,6 +19,9 @@ package org.apache.archiva.checksum;
  * under the License.
  */
 
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+
 import java.nio.ByteBuffer;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -55,7 +58,7 @@ public class Checksum
         if (this.result.length==0) {
             finish();
         }
-        return Hex.encode( this.result );
+        return Hex.encodeHexString( this.result );
     }
 
     public byte[] getChecksumBytes() {
@@ -110,6 +113,10 @@ public class Checksum
         if (this.result == null || this.result.length==0) {
             finish();
         }
-        return MessageDigest.isEqual(this.result, Hex.decode( hexString ));
+        try {
+            return MessageDigest.isEqual(this.result, Hex.decodeHex( hexString ));
+        } catch (DecoderException e) {
+            throw new RuntimeException(e);
+        }
     }
 }
diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java
deleted file mode 100644 (file)
index 6353a87..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.archiva.checksum;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.xml.bind.DatatypeConverter;
-
-/**
- * Hex - simple hex conversions. 
- *
- *
- */
-public class Hex
-{
-
-    public static String encode( byte[] data )
-    {
-        try
-        {
-            return DatatypeConverter.printHexBinary( data ).trim( ).toLowerCase( );
-        } catch (IllegalArgumentException e) {
-            return "";
-        }
-    }
-
-    public static String encode( String raw )
-    {
-        return encode( raw.getBytes() );
-    }
-
-    public static byte[] decode( String data ) {
-        try
-        {
-            return DatatypeConverter.parseHexBinary( data.trim( ) );
-        } catch (IllegalArgumentException e) {
-            return new byte[0];
-        }
-    }
-}
index 6e2f82f47884f1692b5cc7d22ec1f47644f859e7..e049ce2d58c0eb4235277e30ca0734101d6d3e95 100644 (file)
     <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
-      <version>1.9</version>
       <scope>test</scope>
     </dependency>
 
index abad21899047750a5673ad0587cd45760bba123b..310ff577fbfdb6e3da4d323c97dad1833ed444dc 100644 (file)
@@ -343,7 +343,7 @@ Using provided scope to avoid adding it to packaging.
       <dependencies>
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
       </dependencies>
     </profile>
index 59a7642afcce323f084db4d18468477cc4fe8765..9dc186ec95dcda7887baf99dca5f99ec2dc84660 100644 (file)
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
+          <artifactId>jakarta.annotation-api</artifactId>
           <scope>test</scope>
         </dependency>
 
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
index dc3c7da0df5d5f6e1139074fa58ddb3524b27854..840b829f13ef48dc98c1c3faf2d40dba05d8010d 100644 (file)
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
index d6bf57fda2df9010504dfafe46495a7fb63d95a1..69f933c316264b25148b8042f669a4162400ac93 100644 (file)
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
+          <artifactId>jakarta.annotation-api</artifactId>
           <scope>test</scope>
         </dependency>
 
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
index 653256609876fcb217912e9cc367e7b01430004f..841ef71b59578a20972e6540eb2756d4c34ae7a3 100644 (file)
       <dependencies>
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
       </dependencies>
     </profile>
index 1406524776d911c0c4400c0a0032ce7a0f67ac9d..71d3efed21dcc90b107fbfe2915ff77534b8cc9f 100644 (file)
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
+          <artifactId>jakarta.annotation-api</artifactId>
           <scope>test</scope>
         </dependency>
 
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
index eeed333a3fa5c79a793654b025af54df3e84fce2..fbc01e61f6fa81cfc23c6d0a3d801e878c869ec7 100644 (file)
       <dependencies>
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
       </dependencies>
     </profile>
index 16f4d02bf2d24ec92093cd649cc8c7bc86e53c00..2fd158e24673392e8f9d92497bfd7954c45f0175 100644 (file)
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>jdk9+</id>
+      <activation>
+        <jdk>[1.9,)</jdk>
+      </activation>
+      <dependencies>
+        <!-- Needed for JDK >= 9 -->
+        <dependency>
+          <groupId>jakarta.annotation</groupId>
+          <artifactId>jakarta.annotation-api</artifactId>
+          <scope>test</scope>
+        </dependency>
+
+        <dependency>
+          <groupId>jakarta.xml.bind</groupId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+
 </project>
index dc73e13a5c8956176b530567b0e14a0c7371fe69..e44ea64d831289d774967701f561261d21ff2684 100644 (file)
       <dependencies>
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
       </dependencies>
     </profile>
index 8b30065c035a686d0b9efdac1e487bc64eb61b27..b94505b9f4a1eb5e400403ee74e8c53f09bfc22c 100644 (file)
         <!-- Needed for JDK >= 9 -->
         <dependency>
           <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
+          <artifactId>jakarta.annotation-api</artifactId>
           <scope>test</scope>
         </dependency>
 
         <dependency>
           <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
+          <artifactId>jakarta.xml.bind-api</artifactId>
           <scope>test</scope>
         </dependency>
       </dependencies>
diff --git a/pom.xml b/pom.xml
index 12dbaf57a9632a678f65013d3a04d78f25393522..c9717de2f4db1a17042ba5a39b4ac4e2f18ea558 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -75,7 +75,7 @@
     <jakarta.servlet.version>4.0.4</jakarta.servlet.version>
     <jakarta.inject.version>1.0</jakarta.inject.version>
     <jakarta.annotation.version>1.3.5</jakarta.annotation.version>
-    <jakarta.xml.bind.version>3.0.0</jakarta.xml.bind.version>
+    <jakarta.xml.bind.version>2.3.3</jakarta.xml.bind.version>
     <jakarta.transaction.version>1.3.3</jakarta.transaction.version>
     <jakarta.validation.version>2.0.2</jakarta.validation.version>
     <jakarta.ws.rs.version>2.1.6</jakarta.ws.rs.version>
           </exclusion>
         </exclusions>
       </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-annotations</artifactId>
+        <version>2.1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-classworlds</artifactId>
+        <version>2.6.0</version>
+      </dependency>
 
       <dependency>
         <groupId>org.ehcache</groupId>