This message was deleted.
# dependency-management
s
This message was deleted.
r
g
You can also look how this @Jendrik Johannes's plugin fixes similar thing with guava https://github.com/jjohannes/missing-metadata-guava
1
r
Thanks both, that's great
j
I had a similar issue with
guice-noap
referenced by
typesafeconfig-guice
. This is the rule that fixes the metadata of
typesafeconfig-guice
and you could do smth similar for
javafaker
:
Copy code
/**
 * Removes the 'no_aop' classifier from the Guice dependency, because it
 * no longer exists with Guice 5.0 to which we upgrade the dependency.
 */
@CacheableRule
abstract class TypesafeConfigGuiceRule : ComponentMetadataRule {
    companion object {
        const val TYPESAFE_CONFIG_GUICE_MODULE = "com.github.racc:typesafeconfig-guice"
    }

    override fun execute(context: ComponentMetadataContext) {
        context.details.allVariants {
            withDependencies {
                removeIf { it.group == "com.google.inject" }
                add("com.google.inject:guice")
            }
        }
    }
}
🙏 1
Copy code
// register rule:
dependencies.components {
    withModule<TypesafeConfigGuiceRule>(TypesafeConfigGuiceRule.TYPESAFE_CONFIG_GUICE_MODULE)
}
🙏 1
n
we solved it by substituting any request for the android variant with the “normal” one:
Copy code
// javafaker requests the android variant of snakeyaml, which might not always exist
configurations {
  configureEach {
    resolutionStrategy {
      eachDependency {
        if (requested.name == "snakeyaml") {
          artifactSelection {
            selectArtifact("jar", "jar", null)
          }
        }
      }
    }
  }
}
👍 4
j
☝️ That’s also a neat and compact solution for this. I might like it more than mine. 😄 Thanks for sharing @Niels Doucet