From f343158c4af67cb1af514fdba862a30edf4e27b4 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Mon, 13 Mar 2023 21:27:25 +0100 Subject: [PATCH] Prepare to run on Java 19+ --- .github/workflows/maven.yml | 6 +++--- .../src/it/manimalsniffer-49/pom.xml | 6 +++--- .../org/codehaus/mojo/animal_sniffer/ClassListBuilder.java | 2 +- .../org/codehaus/mojo/animal_sniffer/SignatureBuilder.java | 3 +-- .../org/codehaus/mojo/animal_sniffer/SignatureChecker.java | 6 +++--- pom.xml | 4 +++- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4117f76e..35ba7efd 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,9 +26,9 @@ jobs: name: Verify uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3 with: - jdk-matrix: '["8", "11", "17"]' + jdk-matrix: '["8", "11", "17", "20-ea"]' jdk-distribution-matrix: '["temurin", "zulu"]' - ff-jdk: "8" - ff-maven: "3.8.7" # Maven version for fail-fast-build + ff-jdk: "11" + ff-maven: "3.9.0" # Maven version for fail-fast-build maven-matrix: '[ "3.2.5", "3.8.7" ]' # Maven versions matrix for verify builds diff --git a/animal-sniffer-maven-plugin/src/it/manimalsniffer-49/pom.xml b/animal-sniffer-maven-plugin/src/it/manimalsniffer-49/pom.xml index 0fa895ea..c7497995 100644 --- a/animal-sniffer-maven-plugin/src/it/manimalsniffer-49/pom.xml +++ b/animal-sniffer-maven-plugin/src/it/manimalsniffer-49/pom.xml @@ -42,7 +42,7 @@ maven-compiler-plugin - 3.8.1 + 3.11.0 @mojo.java.target@ @mojo.java.target@ @@ -58,8 +58,8 @@ maven-compiler-plugin - 1.6 - 1.6 + 8 + 8 diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassListBuilder.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassListBuilder.java index e895d6cc..3fc97921 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassListBuilder.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassListBuilder.java @@ -67,7 +67,7 @@ protected void process( String name, InputStream image ) try { ClassReader cr = new ClassReader( image ); - cr.accept( new ClassVisitor(Opcodes.ASM7) + cr.accept( new ClassVisitor(Opcodes.ASM9) { public void visit( int version, int access, String name, String signature, String superName, String[] interfaces ) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java index 097e4cc1..5518c801 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java @@ -198,9 +198,8 @@ private class SignatureVisitor { private Clazz clazz; - @SuppressWarnings("deprecation") public SignatureVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } public void visit( int version, int access, String name, String signature, String superName, diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java index 855efcb7..e9d8468e 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java @@ -294,7 +294,7 @@ private class CheckingVisitor public CheckingVisitor( String name ) { - super(Opcodes.ASM7); + super(Opcodes.ASM9); this.ignoredPackageCache = new HashSet<>( 50 * ignoredPackageRules.size() ); this.name = name; } @@ -354,7 +354,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) @Override public FieldVisitor visitField(int access, String name, final String descriptor, String signature, Object value) { - return new FieldVisitor(Opcodes.ASM7) { + return new FieldVisitor(Opcodes.ASM9) { boolean ignoreError = ignoreClass; @@ -385,7 +385,7 @@ public void visitEnd() { public MethodVisitor visitMethod( int access, final String name, final String desc, String signature, String[] exceptions ) { line = 0; - return new MethodVisitor(Opcodes.ASM7) + return new MethodVisitor(Opcodes.ASM9) { /** * True if @IgnoreJRERequirement is set. diff --git a/pom.xml b/pom.xml index f26419a1..86bf1156 100644 --- a/pom.xml +++ b/pom.xml @@ -134,13 +134,15 @@ org.apache.maven.plugins maven-invoker-plugin + 3.5.0 src/it ${project.build.directory}/it ${project.build.directory}/local-repo src/it/settings.xml true - true + false + true verify verify