nebula-plugins / gradle-resolution-rules-plugin

Gradle plugin for providing reusable dependency resolution rules.
Apache License 2.0
44 stars 19 forks source link

There seems to be an issue on Gradle 8.1.1 and init scripts #146

Open remy-tiitre opened 1 year ago

remy-tiitre commented 1 year ago

When I apply the plugin in my build script like this:

plugins {
    id 'java-library'
    id 'com.netflix.nebula.resolution-rules' version '10.2.0'
}

it works, but we apply the plugin in custom Gradle wrapper like this:

initscript {
    dependencies {
        classpath 'com.netflix.nebula:gradle-resolution-rules-plugin:10.2.0'
    }
}

And this crashes with an error:

Could not resolve all files for configuration 'classpath'.
> Could not resolve com.fasterxml.jackson:jackson-bom:{strictly 2.9.10.20210106}.
  Required by:
      unspecified:unspecified:unspecified > com.netflix.nebula:gradle-resolution-rules-plugin:10.2.0
   > Cannot find a version of 'com.fasterxml.jackson:jackson-bom' that satisfies the version constraints:
        Dependency path 'unspecified:unspecified:unspecified' --> 'com.netflix.nebula:gradle-resolution-rules-plugin:10.2.0' (runtimeElements) --> 'com.fasterxml.jackson:jackson-bom:{strictly 2.9.10.20210106}'
...

Is there a reason why its enforcedPlatgorm? implementation enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.9.10.+")

remy-tiitre commented 1 year ago

I think you need the same changes in this project https://github.com/nebula-plugins/nebula-plugin-plugin/commit/d8a8616eb8d963ab06cc11caa2203f14c0033901

remy-tiitre commented 1 year ago

@OdysseusLives I think the original change was done by you, or maybe it was merged by you. I would make a PR, but as I don't know the reasons why it was forced to certain version I would hope someone who does makes the change.