Skip to content

build.gradle incompatible with Gradle 7+: compileOnly not resolvable #1

Closed

Description

@scttfrdmn

Summary

Building nf-spawn with Gradle 7+ fails with:

Could not determine the dependencies of task ':compileGroovy'.
> Resolving dependency configuration 'compileOnly' is not allowed as it is defined as 'canBeResolved=false'.

Root cause

build.gradle defines compileOnly as a custom configuration but doesn't mark it resolvable:

configurations {
    compileOnly                                    // not marked canBeResolved=true
    testImplementation.extendsFrom compileOnly
}
compileGroovy {
    classpath = configurations.compileOnly + ...   // fails Gradle 7+
}

Fix (one-line)

configurations {
    compileOnly { canBeResolved = true }
    ...
}

Context

https://github.com/scttfrdmn/aws-microbiome-demo — building nf-spawn during AMI bake with Gradle 8.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions