-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Gradle Module Metadata - optional dependencies not optional #99
Comments
dom4j#99) The result is the same in the POM - they get marked as optional - but for Gradle Module Metadata they become individual features which users can request.
Workarounds
(Gradle, Groovy DSL) |
Confirming that this issue first appeared in Gradle 6.0. To exclude all optional dependencies of dom4j:
|
dependencies {
components {
withModule('org.dom4j:dom4j', ClearDependencies)
}
}
class ClearDependencies implements ComponentMetadataRule {
void execute(ComponentMetadataContext context) {
context.details.allVariants { withDependencies { clear() } }
}
} (c) melix from gradle/gradle#13656 (comment) |
…adle 6+ will have issues with JAXB resolution, causing confusing errors in their applications
…adle 6+ will have issues with JAXB resolution, causing confusing errors in their applications
…j/dom4j#99) that causes SAX parsing issues for consumers using Gradle 6+
…j/dom4j#99) that causes SAX parsing issues for consumers using Gradle 6+
I have try and got an error at runtime
|
They are optional dependencies, not unnecessary dependencies. If you use the part that needs that dependency, you also need the dependency. The quick and easy way is to add it as |
According to gradle/gradle#13656 (comment) , dom4j has invalid Gradle Module Metadata which can cause projects with a dependency on dom4j to pull in the optional pull-parser:pull-parser:2 dependency as well. This parser seems to have some issues which can result in an error
org.xml.sax.XMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", this)
that the default XML parser on the JVM doesn't throw.Can you look at fixing the Gradle Module Metadata?
Thanks!
The text was updated successfully, but these errors were encountered: