Closed guillermo-varela closed 1 day ago
Tests were made using Gradle Toolchain:
Before upgrading nexus-platform-api
: the plugin was compiled using Java 11 and worked when running it using Java 8.
Before upgrading nexus-platform-api
: the plugin failed to compile.
scan-gradle-plugin/src/main/java/org/sonatype/gradle/plugins/scan/nexus/iq/scan/NexusIqScanTask.java:30: error: cannot access com.sonatype.nexus.api.common.Authentication
import com.sonatype.nexus.api.common.Authentication;
^
bad class file: /.../.gradle/caches/modules-2/files-2.1/com.sonatype.nexus/nexus-platform-api/5.0.0-01/.../nexus-platform-api-5.0.0-01.jar(com/sonatype/nexus/api/common/Authentication.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Additional tests were made and upgrading to use a Gradle version 7.6.2
or higher becomes a requirement not only to build the plugin but also for projects using it.
Failed to create Jar file /.../.gradle/caches/jars-8/.../jackson-core-2.16.0.jar
Currently used version is 4.0.7-01
There are particularities in this versions:
4.0.8-01: doesn't seem to include Logback as logger implementation so nothing gets printed.
4.1.4-01: comes with Jackson 2.15.1 as dependency. From Jackson 2.15.0-rc1 there is a problem when depending on that library in plugins if the target project is using a Gradle version lower than 7.6.2 and this plugin currently is compatible with Gradle 3.3 or higher.
4.3.0-01: introduces a new method related to Legacy Violations.
5.0.0-01: requires Java 11.
How could we solve this issue? (Not knowing is okay!)
We'd need to stop supporting Gradle versions lower than 7.6.2
Experiment with Gradle Toolchain and see if we can compile the plugin with Java 11 and keep it working on projects using Java 8. See https://discuss.gradle.org/t/compile-with-java-11-to-java-8-language-level/39123/5
cc @bhamail / @DarthHater / @shaikhu