gradlex-org / extra-java-module-info

A Gradle 6.8+ plugin to use legacy Java libraries as Java Modules in a modular Java project
Apache License 2.0
104 stars 6 forks source link

This plug-in affects unrelated jars? #122

Closed hrstoyanov closed 7 months ago

hrstoyanov commented 7 months ago

I added this to my conventions:

plugins {
...
   id("org.gradlex.extra-java-module-info") //https://github.com/gradlex-org/extra-java-module-info
}

with the intention to modularize this jar:

extraJavaModuleInfo {
    automaticModule("stringsearchalgorithms-logging:stringsearchalgorithms", "net.amygdalum")
}

However, I am getting an erro with an unrelated jar I did not have problems with . Why??? Note that issue immediately starts only by including the plugin!

* What went wrong:
Execution failed for task ':peruncs-eclipsestore:compileJava'.
> Could not resolve all files for configuration ':peruncs-eclipsestore:compileClasspath'.
   > Failed to transform aws-crt-0.29.9.jar (software.amazon.awssdk.crt:aws-crt:0.29.9) to match attributes {artifactType=jar, javaModule=true, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for ExtraJavaModuleInfoTransform: /Users/hristo/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk.crt/aws-crt/0.29.9/69a635d4e86536d68c413fb8c998ff80d099e454/aws-crt-0.29.9.jar.
         > Not a module and no mapping defined: aws-crt-0.29.9.jar
jjohannes commented 7 months ago

Hi. The plugin is always looking at all Jars on the class/module path, as the main objective is to help users to get to a clean Java Modules setup. By default, it is configured to fail for Jars that do not even have a Module Name.

You can turn off the fail behavior via:

extraJavaModuleInfo {
    failOnMissingModuleInfo = false
}