ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.82k stars 199 forks source link

Unable to resolve latest version #817

Closed emartynov closed 8 months ago

emartynov commented 8 months ago

Might be gradle issue (Gradle version 8.4).

I see in info log

The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.junit.jupiter:junit-jupiter-engine:+.
Required by:
    project :app
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Failed to list versions for org.junit.jupiter:junit-jupiter-engine.
Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-engine/maven-metadata.xml.

And way down below:

org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized

I downloaded maven-metadata.xml for junit jupiter but I don't see such property inside.

ben-manes commented 8 months ago

See release notes. Gradle requires system properties to allow xml parsing as many plugins, e.g. android, including the legacy xerces parser.

ben-manes commented 8 months ago

https://docs.gradle.org/current/userguide/upgrading_version_8.html#xml_parsing_now_requires_recent_parsers

emartynov commented 8 months ago

Thank you!

Adding these lines to gradle.properties works:

systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

I wonder when I should remove them.

ben-manes commented 8 months ago

You can look at buildEnvironment to see what pulls in xerces and try an exclusion, but when/if depends on the plugin.