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

Build: Spotless plugin failure due to "too many variants" #4655

Closed
snazy opened this issue Jul 7, 2022 · 0 comments
Closed

Build: Spotless plugin failure due to "too many variants" #4655

snazy opened this issue Jul 7, 2022 · 0 comments

Comments

@snazy
Copy link
Member

snazy commented Jul 7, 2022

The (innocent) PR #4649 unveiled that the Spotless plugin (since 6.6.1 up to most recent version 6.8.0) has not fixed diffplug/spotless#1215 yet. The same issue happened in cel-java projectnessie/cel-java#185.

There's currently no fix available, just a workaround to run spotless related tasks separately from tasks that build code (which includes checkstyle).

$ ./gradlew check
Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':nessie-versioned-spi:intTest'.
> Could not resolve all task dependencies for configuration ':nessie-versioned-spi:testRuntimeClasspath'.
   > Could not resolve project :.
     Required by:
         project :nessie-versioned-spi
      > The consumer was configured to find a runtime of a platform compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally. However we cannot choose between the following variants of project ::
          - runtimeElements
          - spotless1316845952
          - spotless617803313
        All of them match the consumer attributes:
          - Variant 'runtimeElements' capability org.projectnessie:nessie:0.30.1-SNAPSHOT declares a runtime of a platform:
              - Unmatched attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'spotless1316845952' capability org.projectnessie:nessie:0.30.1-SNAPSHOT declares a component, and its dependencies declared externally:
              - Unmatched attributes:
                  - Doesn't say anything about its component category (required a platform)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about its usage (required a runtime)
          - Variant 'spotless617803313' capability org.projectnessie:nessie:0.30.1-SNAPSHOT declares a component, and its dependencies declared externally:
              - Unmatched attributes:
                  - Doesn't say anything about its component category (required a platform)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about its usage (required a runtime)
        The following variants were also considered but didn't match the requested attributes:
          - Variant 'apiElements' capability org.projectnessie:nessie:0.30.1-SNAPSHOT declares a platform:
              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'enforcedApiElements' capability org.projectnessie:nessie-derived-enforced-platform:0.30.1-SNAPSHOT:
              - Incompatible because this component declares an API of an enforced platform and the consumer needed a runtime of a platform
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'enforcedRuntimeElements' capability org.projectnessie:nessie-derived-enforced-platform:0.30.1-SNAPSHOT declares a runtime of a component:
              - Incompatible because this component declares an enforced platform and the consumer needed a platform
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
12 actionable tasks: 12 up-to-date
snazy added a commit to snazy/nessie that referenced this issue Jul 7, 2022
snazy added a commit to snazy/nessie that referenced this issue Jul 7, 2022
snazy added a commit that referenced this issue Jul 7, 2022
@snazy snazy closed this as completed Jan 20, 2023
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