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

Gradle - Apache Groovy 4 - Incompatible because this component declares a platform and the consumer needed a library #429

Open
3 of 4 tasks
puneetbehl opened this issue Feb 7, 2024 · 3 comments

Comments

@puneetbehl
Copy link
Contributor

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

We are trying to update the Apache Groovy dependency to the version v4.0.12. Please checkout to branch upgrade/groovy.

Steps to Reproduce

  1. Update the groovyVersion Gradle property to 4.0.12.
  2. Try to build the project.

Expected Behaviour

The project should be able to resolve the dependencies

Actual Behaviour

The project could not resolve org.apache.groovy:groovy-bom:4.0.12 with following error:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':grails-plugin-gsp'.
> Could not resolve all dependencies for configuration ':grails-plugin-gsp:runtimeClasspath'.
   > A problem occurred configuring project ':grails-plugin-sitemesh2'.
      > Could not resolve all files for configuration ':grails-plugin-sitemesh2:runtimeClasspath'.
         > Could not resolve org.apache.groovy:groovy-bom:4.0.12.
           Required by:
               project :grails-plugin-sitemesh2
               project :grails-plugin-sitemesh2 > project :grails-web-sitemesh
               project :grails-plugin-sitemesh2 > project :grails-web-jsp
               project :grails-plugin-sitemesh2 > project :grails-web-jsp > project :grails-web-gsp
               project :grails-plugin-sitemesh2 > project :grails-web-jsp > org.grails:grails-web-common:6.1.2 > project :grails-gsp
               project :grails-plugin-sitemesh2 > project :grails-web-jsp > project :grails-web-gsp > project :grails-web-taglib
               project :grails-plugin-sitemesh2 > project :grails-web-jsp > org.grails:grails-web-common:6.1.2 > project :grails-gsp > project :grails-taglib
            > No matching variant of org.apache.groovy:groovy-bom:4.0.12 was found. The consumer was configured to find a runtime of a library compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
                - Variant 'apiElements' capability org.apache.groovy:groovy-bom:4.0.12:
                    - Incompatible because this component declares an API of a platform and the consumer needed a runtime of a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'enforcedApiElements' capability org.apache.groovy:groovy-bom-derived-enforced-platform:4.0.12:
                    - Incompatible because this component declares an API of an enforced platform and the consumer needed a runtime of a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'enforcedRuntimeElements' capability org.apache.groovy:groovy-bom-derived-enforced-platform:4.0.12 declares a runtime of a component:
                    - Incompatible because this component declares an enforced platform and the consumer needed a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'runtimeElements' capability org.apache.groovy:groovy-bom:4.0.12 declares a runtime of a component:
                    - Incompatible because this component declares a platform and the consumer needed a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
         > Could not resolve org.codehaus.groovy:groovy-bom:3.0.13.
           Required by:
               project :grails-plugin-sitemesh2 > org.grails:grails-plugin-codecs:6.1.2 > org.grails:grails-encoder:6.1.2 > org.grails:grails-core:6.1.2 > io.micronaut.spring:micronaut-spring-context:4.5.1 > io.micronaut:micronaut-bom:3.10.3
               project :grails-plugin-sitemesh2 > org.grails:grails-plugin-codecs:6.1.2 > org.grails:grails-encoder:6.1.2 > org.grails:grails-core:6.1.2 > io.micronaut.spring:micronaut-spring-context:4.5.1 > io.micronaut:micronaut-bom:3.10.3 > io.micronaut.groovy:micronaut-groovy-bom:3.4.0
            > No matching variant of org.apache.groovy:groovy-bom:4.0.12 was found. The consumer was configured to find a runtime of a library compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
                - Variant 'apiElements' capability org.apache.groovy:groovy-bom:4.0.12:
                    - Incompatible because this component declares an API of a platform and the consumer needed a runtime of a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'enforcedApiElements' capability org.apache.groovy:groovy-bom-derived-enforced-platform:4.0.12:
                    - Incompatible because this component declares an API of an enforced platform and the consumer needed a runtime of a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'enforcedRuntimeElements' capability org.apache.groovy:groovy-bom-derived-enforced-platform:4.0.12 declares a runtime of a component:
                    - Incompatible because this component declares an enforced platform and the consumer needed a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)
                - Variant 'runtimeElements' capability org.apache.groovy:groovy-bom:4.0.12 declares a runtime of a component:
                    - Incompatible because this component declares a platform and the consumer needed a library
                    - 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 17)
                        - Doesn't say anything about its elements (required them packaged as a jar)

* Try:
> Run with --info or --debug option to get more log output.

Environment Information

  • Operating System: macIS Sonoma - Version 14.3 Beta
  • Grails Version: 7.0.x
  • JDK Version: Java 17 - zulu
@puneetbehl
Copy link
Contributor Author

@paulk-asert Could you please take a quick look at this?

@matrei
Copy link
Contributor

matrei commented Feb 7, 2024

@puneetbehl Could it be that the dependencies have to be upgraded to Groovy 4 first?

@paulk-asert
Copy link
Contributor

I somehow suspect you are bumping into this:
https://issues.apache.org/jira/browse/GROOVY-10543
Which should be fixed from 4.0.2 (so bumping from 4.0.2 to 4.0.12 should work) but perhaps some earlier version is being brought in somewhere. Groovy 4.0.0/4.0.1 tried to be both a platform and a library but that seemed to break more things than solve things. Are there any references to groovy-all still trying to reference it as platform?
I'll try to look further in a couple of days.

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

3 participants