grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.78k stars 951 forks source link

Error when loading project with Gradle #13587

Open matrei opened 3 weeks ago

matrei commented 3 weeks ago

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

ellakarlina444 commented 3 weeks ago

did u solve this? im facing the same problem

jamesfredley commented 3 weeks ago

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 buildSrcand 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')
            }
        }
    }
ellakarlina444 commented 3 weeks ago

fetching the maven takes forever

PratikDodiya commented 2 weeks ago

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/" }
        ...
    }
}