ben-manes/gradle-versions-plugin

Unable to resolve latest version

emartynov opened this issue · 4 comments

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.

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

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.

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