Gradle 6.0 fails to find dependencies in p2asmaven repository

The WALA analysis framework uses the com.diffplug.gradle.p2.asmaven plugin to incorporate several Eclipse libraries into its build, as configured here. This worked fine under Gradle 5.6.2, but under Gradle 6.0 these p2asmaven dependencies fail to be resolved:

* What went wrong:
Execution failed for task ':com.ibm.wala.ide:compileJava'.
> Could not resolve all files for configuration ':com.ibm.wala.ide:compileClasspath'.
   > Could not find any matches for eclipse-deps:org.eclipse.pde.core:+ as no versions of eclipse-deps:org.eclipse.pde.core are available.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/eclipse-deps/org.eclipse.pde.core/maven-metadata.xml
       - file:[...]/WALA/build/p2asmaven/maven/eclipse-deps/org.eclipse.pde.core/maven-metadata.xml
       - file:[...]/WALA/build/p2asmaven/maven/eclipse-deps/org.eclipse.pde.core/3.11.100.v20170517-0724/org.eclipse.pde.core-3.11.100.v20170517-0724.pom
     Required by:
         project :com.ibm.wala.ide

[Many more, similar “Could not find any matches” failures follow.]

Running a low-level system-call trace on the Gradle process shows me that both Gradle 5.6.2 and Gradle 6.0 open and read WALA/build/p2asmaven/maven/eclipse-deps/org.eclipse.pde.core/maven-metadata.xml, then look for (but fail to find) WALA/build/p2asmaven/maven/eclipse-deps/org.eclipse.pde.core/3.11.100.v20170517-0724/org.eclipse.pde.core-3.11.100.v20170517-0724.pom. After failing to find this POM file, Gradle 5.6.2 looks for and finds a Jar archive instead: WALA/build/p2asmaven/maven/eclipse-deps/org.eclipse.pde.core/3.11.100.v20170517-0724/org.eclipse.pde.core-3.11.100.v20170517-0724.jar. Unfortunately, Gradle 6.0 never even looks for such a file.

Is the problem here with p2.asmaven failing to create necessary POM files? Or should Gradle 6.0 be finding the Jar archives even without the POM files, as Gradle 5.6.2 did? Any suggestions on how I can get this p2.asmaven-created Maven repository back into working order for use with Gradle 6.0?

Thank you for any clues!

Hi @liblit,

You are running into this (breaking) change:
https://docs.gradle.org/current/userguide/upgrading_version_5.html#maven_or_ivy_repositories_are_no_longer_queried_for_artifacts_without_metadata_by_default

It’s a performance optiomization that now assumes that all Maven repositories follow the standard Maven layout (i.e. there always is a maven-metadata.xml and poms)
You need to add the artifact() metadata sources to the p2asmaven repository declaration to tell Gradle that the repo is not always following these conventions.

Ultimately I was able to stop using p2.asmaven entirely, as the Eclipse libraries I need are now co-published in public Maven repositories. But it is great to have this fix documented and findable in the future in case someone does not have that option. Thank you for this expert diagnosis, @jendrik!

Happy to help @liblit. Thanks for reporting this to the Goomph project.