Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

maven - Grails 2.2.x unresolved dependencies without any changes to previously working build

We have a Grails 2.2.4 project that I was looking to do some work on. There has been no work done on it for six months, but it built just fine back then.

When I try to run grails clean now I get a host of UNRESOLVED DEPENDENCIES errors. This is despite all dependencies working just fine a few months ago. Has something changed within that time on the repository side?

I have changed the log level within BuildConfig.groovy to log "warn" as suggested by the error message. The interesting thing from this is when I try to download via a browser some of the URLs that the build tries to resolve, they download fine. I'm not sure why the build process can't download.

 ==== grailsCentral: tried

          http://grails.org/plugins/grails-quartz/tags/RELEASE_1.0.2/quartz-1.0.2.pom

          -- artifact org.grails.plugins#quartz;1.0.2!quartz.zip:

          http://grails.org/plugins/grails-quartz/tags/RELEASE_1.0.2/grails-quartz-1.0.2.zip

Here are all the dependencies that used to resolve that don't now:

                ::::::::::::::::::::::::::::::::::::::::::::::

                ::          UNRESOLVED DEPENDENCIES         ::

                ::::::::::::::::::::::::::::::::::::::::::::::

                :: org.grails.plugins#asset-pipeline;2.1.3: not found

                :: org.grails.plugins#less-asset-pipeline;2.0.8: not found

                :: org.grails.plugins#rest;0.8: not found

                :: org.grails.plugins#quartz;1.0.2: not found

                ::::::::::::::::::::::::::::::::::::::::::::::
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like the default grails repo provided in 2.2 does not work now. We fixed this issue by adding the following line to the grails.project.dependency.resolution closure in the BuildConfig.groovy file:

grails.project.dependency.resolution = {
    /** Existing stuff here **/
    repositories {
        /** Other repos stay here **/

        //--------  NEW REPO TO ADD IS BELOW --------//
        mavenRepo "http://repo.grails.org/grails/repo/"
    }
    ...
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...