gradle-spoon-plugin
gradle-spoon-plugin copied to clipboard
Including spoon in buildSrc dependencies causes build to fail
Gradle Version: 6.7.1 Android Plugin Version: 4.2.1
Including the spoon plugin jar in the dependencies of buildSrc/build.gradle.kts
implementation("com.jaredsburrows:gradle-spoon-plugin:1.5.1")
will cause the build to fail with the following error:
Configure project :app
Error loading androidx migration mapping: org/w3c/dom/ElementTraversal
> Task :app:mergeDebugResources FAILED
This worked previously in 4.0.1 / gradle 6.6.x
I tried including xml-apis directly thinking maybe it would get that in the classpath, but it did not change the outcome
More specifically, it looks like i can produce this merely by including the spoon-runner dependency. I realize that's not directly part of this plugin, but it does cause the plugin to be broken under the latest android gradle plugin.
What is the use case for applying this in the buildSrc
? To make it shared across projects?
I experienced the same issue Gradle Version: 6.7.1 Android Plugin Version: 4.2.2
My usecase is on a project with multiple subprojects I found this reference: https://stackoverflow.com/questions/17515333/noclassdeffounderror-org-w3c-dom-elementtraversal using classpath ('com.jaredsburrows:gradle-spoon-plugin:1.5.0') { exclude module: "xml-apis" } has worked but seems like a workaround
This works after I release a new version fixing the build from this change https://github.com/jaredsburrows/gradle-spoon-plugin/issues/121 / https://github.com/jaredsburrows/gradle-spoon-plugin/pull/301:
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
gradlePluginPortal()
google()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
}
dependencies {
implementation("com.jaredsburrows:gradle-spoon-plugin:1.5.1")
}