From f150f4204209f7e1ab7e998e321e5a03dcfe9dce Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 6 Jun 2022 09:46:02 +1000 Subject: fix upperbound and jdk 11 build Signed-off-by: Olivier Lamy --- .../archiva-base/archiva-checksum/pom.xml | 8 +++- .../java/org/apache/archiva/checksum/Checksum.java | 11 ++++- .../main/java/org/apache/archiva/checksum/Hex.java | 55 ---------------------- .../archiva-consumer-archetype/pom.xml | 1 - .../archiva-core-consumers/pom.xml | 2 +- .../archiva-base/archiva-policies/pom.xml | 4 +- archiva-modules/archiva-base/archiva-proxy/pom.xml | 2 +- .../archiva-base/archiva-transaction/pom.xml | 4 +- .../archiva-maven/archiva-maven-proxy/pom.xml | 2 +- .../archiva-maven/archiva-maven-repository/pom.xml | 4 +- .../archiva-rest/archiva-rest-api/pom.xml | 2 +- .../archiva-rest/archiva-rest-services/pom.xml | 23 +++++++++ .../archiva-web/archiva-web-common/pom.xml | 2 +- archiva-modules/plugins/problem-reports/pom.xml | 4 +- pom.xml | 12 ++++- 15 files changed, 62 insertions(+), 74 deletions(-) delete mode 100644 archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java diff --git a/archiva-modules/archiva-base/archiva-checksum/pom.xml b/archiva-modules/archiva-base/archiva-checksum/pom.xml index f376623a3..bd8c9c89d 100644 --- a/archiva-modules/archiva-base/archiva-checksum/pom.xml +++ b/archiva-modules/archiva-base/archiva-checksum/pom.xml @@ -54,6 +54,10 @@ commons-io commons-io + + commons-codec + commons-codec + @@ -83,13 +87,13 @@ jakarta.annotation - jakarta.annotation-api + jakarta.annotation-api test jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java index d32e5fb5e..5c9e2f0fa 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java @@ -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 index 6353a87f1..000000000 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java +++ /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]; - } - } -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index 6e2f82f47..e049ce2d5 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -123,7 +123,6 @@ commons-codec commons-codec - 1.9 test diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml index abad21899..310ff577f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml @@ -343,7 +343,7 @@ Using provided scope to avoid adding it to packaging. jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api diff --git a/archiva-modules/archiva-base/archiva-policies/pom.xml b/archiva-modules/archiva-base/archiva-policies/pom.xml index 59a7642af..9dc186ec9 100644 --- a/archiva-modules/archiva-base/archiva-policies/pom.xml +++ b/archiva-modules/archiva-base/archiva-policies/pom.xml @@ -147,13 +147,13 @@ jakarta.annotation - jakarta.annotation-api + jakarta.annotation-api test jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index dc3c7da0d..840b829f1 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -181,7 +181,7 @@ jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/archiva-modules/archiva-base/archiva-transaction/pom.xml b/archiva-modules/archiva-base/archiva-transaction/pom.xml index d6bf57fda..69f933c31 100644 --- a/archiva-modules/archiva-base/archiva-transaction/pom.xml +++ b/archiva-modules/archiva-base/archiva-transaction/pom.xml @@ -69,13 +69,13 @@ jakarta.annotation - jakarta.annotation-api + jakarta.annotation-api test jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml b/archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml index 653256609..841ef71b5 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml @@ -267,7 +267,7 @@ jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml b/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml index 140652477..71d3efed2 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml +++ b/archiva-modules/archiva-maven/archiva-maven-repository/pom.xml @@ -377,13 +377,13 @@ jakarta.annotation - jakarta.annotation-api + jakarta.annotation-api test jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml index eeed333a3..fbc01e61f 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml @@ -154,7 +154,7 @@ jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml index 16f4d02bf..2fd158e24 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml @@ -564,4 +564,27 @@ + + + jdk9+ + + [1.9,) + + + + + jakarta.annotation + jakarta.annotation-api + test + + + + jakarta.xml.bind + jakarta.xml.bind-api + test + + + + + diff --git a/archiva-modules/archiva-web/archiva-web-common/pom.xml b/archiva-modules/archiva-web/archiva-web-common/pom.xml index dc73e13a5..e44ea64d8 100644 --- a/archiva-modules/archiva-web/archiva-web-common/pom.xml +++ b/archiva-modules/archiva-web/archiva-web-common/pom.xml @@ -611,7 +611,7 @@ jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api diff --git a/archiva-modules/plugins/problem-reports/pom.xml b/archiva-modules/plugins/problem-reports/pom.xml index 8b30065c0..b94505b9f 100644 --- a/archiva-modules/plugins/problem-reports/pom.xml +++ b/archiva-modules/plugins/problem-reports/pom.xml @@ -168,13 +168,13 @@ jakarta.annotation - jakarta.annotation-api + jakarta.annotation-api test jakarta.xml.bind - jakarta.xml.bind-api + jakarta.xml.bind-api test diff --git a/pom.xml b/pom.xml index 12dbaf57a..c9717de2f 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 4.0.4 1.0 1.3.5 - 3.0.0 + 2.3.3 1.3.3 2.0.2 2.1.6 @@ -1706,6 +1706,16 @@ + + org.codehaus.plexus + plexus-component-annotations + 2.1.0 + + + org.codehaus.plexus + plexus-classworlds + 2.6.0 + org.ehcache -- cgit v1.2.3