kordamp / jdeps-gradle-plugin

Run JDeps on a Gradle build
Apache License 2.0
35 stars 10 forks source link

[0.8.0] java.lang.module.FindException: Unable to derive module descriptor #12

Closed boris-petrov closed 2 years ago

boris-petrov commented 4 years ago

After updating to 0.8.0 I started getting a million of those:

Exception in thread "main" java.lang.module.FindException: Unable to derive module descriptor for /home/boris/.gradle/caches/modules-2/files-2.1/org.apache.tika/tika-parsers/1.22/b8a823128f6165882ae41de3ded8655609d62d88/tika-parsers-1.22.jar
    at java.base/jdk.internal.module.ModulePath.readJar(ModulePath.java:646)
    at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:329)
    at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:235)
    at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:188)
    at java.base/jdk.internal.module.ModulePath.findAll(ModulePath.java:164)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:558)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
    at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.tika.parser.external.CompositeExternalParser not in module
    at java.base/jdk.internal.module.ModulePath.deriveModuleDescriptor(ModulePath.java:553)
    at java.base/jdk.internal.module.ModulePath.readJar(ModulePath.java:642)
    ... 9 more

This is using Gradle 6.0 RC1 and Java 13. Any ideas?

aalmiray commented 4 years ago

Do you get similar errors with previous versions of the JDK? I'd like to find out if there was a change in the jdeps tool.

boris-petrov commented 4 years ago

I don't think I'll be able to try with a different JDK, but I can tell you that I upgraded the jdeps plugin from version 0.4.1 to 0.8.0 and these errors started appearing. On the same JDK. So I would guess that something in the plugin changed rather than in the jdeps tool.

aalmiray commented 4 years ago

Well from the top of my head I recall that multi-release JAR support was added recently though I don't think that may be the cause. Also, jdkInternals is enabled by default. The plugin invokes jdeps as an system process which is why I thought a different JDK might be the cause.

aalmiray commented 2 years ago

Cannot reproduce with latest. Closing.

boris-petrov commented 2 years ago

@aalmiray - are you sure? I still get those with org.kordamp.gradle.jdeps 0.16.0 and Gradle 7.3.3. Do you need a reproduction?

aalmiray commented 2 years ago

If you can still reproduce and have access to a reproducer, then yes, thanks.

boris-petrov commented 2 years ago

@aalmiray

build.gradle:

plugins {
    id 'java'
    id 'org.kordamp.gradle.jdeps' version '0.16.0'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.apache.xmlgraphics:batik-transcoder:1.14'
}

Run gradle jdepsReport on this and you'll see the errors. I also get similar errors when one sub-project of mine depends on another, i.e. depends on the JAR. I couldn't reproduce it easily so let's try fixing this one first and then I'll see if the other still happens.