grails-core icon indicating copy to clipboard operation
grails-core copied to clipboard

Error when loading project with Gradle

Open matrei opened this issue 1 year ago • 3 comments

Expected Behavior

Gradle should load the the project without issues

Actual Behaviour

All of a sudden, I'm getting this error when loading the project with Gradle:

A problem occurred configuring root project 'grails.core.ROOT'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find http-builder-0.7.2.jar (org.codehaus.groovy.modules.http-builder:http-builder:0.7.2).
     Searched in the following locations:
         https://plugins.gradle.org/m2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.2/http-builder-0.7.2.jar

It's strange, 0.7.2 is not in the list here: https://mvnrepository.com/artifact/org.codehaus.groovy.modules.http-builder/http-builder but it exists here: https://mvnrepository.com/artifact/org.codehaus.groovy.modules.http-builder/http-builder/0.7.2

Downgrading to 0.7.1 works.

Related: https://github.com/jgritman/httpbuilder/issues/35, https://github.com/ratpack/ratpack/commit/a63078c1bd8d380c144ae2dd8c3b3b47c5bff741

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

6.2.x, 7.0.x

matrei avatar Aug 20 '24 09:08 matrei

did u solve this? im facing the same problem

ellakarlina444 avatar Aug 22 '24 13:08 ellakarlina444

It has been removed for the upcoming Grails 7 release. For prior versions, this is an intermittent issue that might be caused by a 400 error on the spring repo which is potentially rechecked on some interval by repo.grails.org.

I'd make sure you have the Grails Repo in buildSrc and build.gradle buildscript->repositories

maven { url "https://repo.grails.org/grails/core/" }

It will get downloaded from https://repo.grails.org/ui/native/core/org/codehaus/groovy/modules/http-builder/http-builder/0.7.2/

You could also change org.codehaus.groovy.modules.http-builder:http-builder:0.7.2 to org.codehaus.groovy.modules.http-builder:http-builder:0.7.1 by placing the following in buildSrc or build.gradle

configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            if (details.requested.group == 'org.codehaus.groovy.modules.http-builder') {
                details.useTarget(group: details.requested.group, name: details.requested.name, version: '0.7.1')
            }
        }
    }

jamesfredley avatar Aug 22 '24 13:08 jamesfredley

fetching the maven takes forever

ellakarlina444 avatar Aug 22 '24 14:08 ellakarlina444

Please add below line in Project-level build.gradle

buildscript {
    repositories {
        maven { url "https://repo.grails.org/grails/core/" }
        ...
    }
}
allprojects {
    repositories {
        maven { url "https://repo.grails.org/grails/core/" }
        ...
    }
}

PratikDodiya avatar Aug 30 '24 18:08 PratikDodiya

Thank you PratikDodya

ambastos avatar Sep 17 '24 19:09 ambastos

@PratikDodiya I did this,but it still do not download from "https://repo.grails.org/grails/core/"

echocde avatar Sep 24 '24 07:09 echocde

@jamesfredley

I have got another issue after applying your suggestion

Unable to load class 'org.gradle.initialization.BuildCompletionListener' org.gradle.initialization.BuildCompletionListener

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart) Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

kephakhang avatar Oct 04 '24 05:10 kephakhang

Fixed by #13588, #13716

matrei avatar Oct 04 '24 05:10 matrei

@kephakhang I would take a look at the Grails 6.2.1 release which removes http-builder entirely and make sure you are running Gradle 7.6.4 for Grails 6. Grails 7 will be on Gradle 8.10+.

Do ./gradlew clean

and possibly clear your local user maven and gradle cache entirely, to start with a clean surface

jamesfredley avatar Oct 04 '24 12:10 jamesfredley

In my case, I had a library imported as a project, called quickcation, that had a plugin id "com.jfrog.bintray" version "1.7", It can compile without that plugin, so commented it out. It solved the issue, but have also applied the above resolutions suggested too.

PKReejesh avatar Nov 11 '24 07:11 PKReejesh