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

Exclude org.codehaus.groovy:2.4.6 from groovydoc-gradle-plugin #356

Closed

Conversation

jamesfredley
Copy link
Contributor

Resolves the following:

A problem occurred configuring root project 'fields'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.codehaus.groovy:groovy-groovydoc:2.4.6.
     Required by:
         root project : > io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1
      > Module 'org.codehaus.groovy:groovy-groovydoc' has been rejected:
           Cannot select module with conflict on capability 'org.codehaus.groovy:groovy-groovydoc:2.4.6' also provided by [org.apache.groovy:groovy-groovydoc:4.0.22(groovyRuntimeElements)]
   > Could not resolve org.apache.groovy:groovy:4.0.22.
     Required by:
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-ant:4.0.22
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-json:4.0.22
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-jmx:4.0.22
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-ant:4.0.22 > org.apache.groovy:groovy-bom:4.0.22
      > Module 'org.apache.groovy:groovy' has been rejected:
           Cannot select module with conflict on capability 'org.codehaus.groovy:groovy:4.0.22' also provided by [org.codehaus.groovy:groovy:2.4.6(runtime)]
   > Could not resolve org.codehaus.groovy:groovy:2.4.6.
     Required by:
         root project : > io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1 > org.codehaus.groovy:groovy-groovydoc:2.4.6
         root project : > io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1 > org.codehaus.groovy:groovy-groovydoc:2.4.6 > org.codehaus.groovy:groovy-templates:2.4.6
         root project : > io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1 > org.codehaus.groovy:groovy-groovydoc:2.4.6 > org.codehaus.groovy:groovy-templates:2.4.6 > org.codehaus.groovy:groovy-xml:2.4.6
      > Module 'org.codehaus.groovy:groovy' has been rejected:
           Cannot select module with conflict on capability 'org.codehaus.groovy:groovy:2.4.6' also provided by [org.apache.groovy:groovy:4.0.22(groovyRuntimeElements)]
   > Could not resolve org.apache.groovy:groovy-groovydoc:4.0.22.
     Required by:
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-ant:4.0.22
         root project : > org.grails:grails-gradle-plugin:7.0.0-SNAPSHOT:20240918.041752-18 > org.grails:grails-shell:7.0.0-SNAPSHOT:20240917.014737-33 > org.apache.groovy:groovy-ant:4.0.22 > org.apache.groovy:groovy-bom:4.0.22
      > Module 'org.apache.groovy:groovy-groovydoc' has been rejected:
           Cannot select module with conflict on capability 'org.codehaus.groovy:groovy-groovydoc:4.0.22' also provided by [org.codehaus.groovy:groovy-groovydoc:2.4.6(runtime)]

* 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 265ms

Copy link
Contributor

@codeconsole codeconsole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure all that is necessary. I think you might just be able to remove groovyVersion from gradle.properties. The grails-gradle-plugin will swap out all groovy references to groovy 4 if the property groovyVersion is set.

@jamesfredley jamesfredley changed the title Use Groovy version from Gradle for build Exclude org.codehaus.groovy:2.6.x from groovydoc-gradle-plugin Sep 22, 2024
@jamesfredley jamesfredley changed the title Exclude org.codehaus.groovy:2.6.x from groovydoc-gradle-plugin Exclude org.codehaus.groovy:2.4.6 from groovydoc-gradle-plugin Sep 22, 2024
@jamesfredley
Copy link
Contributor Author

Updated to just exclude to the very old Groovy dependency

        classpath 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1', {
            exclude group:'org.codehaus.groovy'
        }

@jamesfredley
Copy link
Contributor Author

Will be fixed by grails/grails-gradle-plugin#337

@jamesfredley
Copy link
Contributor Author

The order of repositories and dependencies in buildscript{} is critical. grails-gradle-plugin must load first, since it fixes the Groovy version for other dependencies and that means is should come from the first repository on the list and be the first dependency listed under buildscript{}

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

Successfully merging this pull request may close these issues.

2 participants