Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with Gradle kotlin-dsl plugin #141

Open
cslee00 opened this issue Dec 16, 2021 · 0 comments
Open

Conflict with Gradle kotlin-dsl plugin #141

cslee00 opened this issue Dec 16, 2021 · 0 comments

Comments

@cslee00
Copy link

cslee00 commented Dec 16, 2021

When writing Gradle plugins that use Kotlin DSL there is a conflict w/ resolution-rules, resulting in this error:

Cannot change attributes of dependency configuration ':apiElements-published' after it has been resolved

The issue is related to the order of the plugins - changing kotlin-dsl to be following resolution-rules works. Considering this a workaround (at best) as it may not always be an option and indicates some underlying fragility.

This minimal build script reproduces the issue (build.gradle.kts)

plugins {
    // if kotlin-dsl plugin is loaded first that results in this error:
    //   Cannot change attributes of dependency configuration ':apiElements-published' after it has been resolved

    // flipping the order is works as expected
    `kotlin-dsl`

    id("nebula.resolution-rules") version "9.0.0"
}

repositories {
    mavenCentral()
}

dependencies {
    resolutionRules("com.netflix.nebula:gradle-resolution-rules:latest.release")
}

Reproducible on Gradle 7.1.1 thru 7.3.2 (earlier versions were not tested).
Reproducible on resolution-rules v9.0.0 (v8.0.0 works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant