Grails: refresh dependencies

怎甘沉沦 提交于 2019-12-12 07:23:46

问题


I am using STS and sometimes when I stop my app on a crash it opens up to a hundred different class files that seem to be deep deep inner working stuff. HTTPBuilder just stopped working, and I suspect its because I accidentally typed in one of these files and absent mindedly saved it. If I somehow destroyed a local file involved in HTTPBuilder, how would I refresh my dependencies? (have done install-plugin rest and also uncommented everything in BuildConfig.groovy repositories)

My specific problem and error is here: Grails: HTTPBuilder stopped working suddenly

UPDATE: As much as I would love to blame STS, as you can see from my answer to my own other question, I was purely thwarted by my own carelessness.


回答1:


We had an issue today that we suspect was due to the Artifactory Migration. Your problem may be similar. The first thing we did to diagnose the issue was to turn up the debug logging in BuildConfig.groovy (change log "warn" to log "debug"). Once we did that, it was evident that the Grails repos in Artifactory appear to be responding differently to queries made to calculate dependencies. To workaround these issues, we:

  1. Removed grailsCentral, grailsHome, and grailsPlugins from BuildConfig
  2. Added grailsRepo "http://grails.org/plugins" to BuildConfig
  3. Changed one of our dependencies so that its transitive dependencies used specific versions instead of version ranges.

For 3, our specific example was to change:

runtime 'com.amazonaws:aws-java-sdk:1.3.4'

to

runtime 'com.amazonaws:aws-java-sdk:1.3.4', {
            excludes "commons-logging",
                "httpclient", "jackson-core-asl", "jackson-mapper-asl"
        }
runtime 'org.codehaus.jackson:jackson-core-asl:1.7.9' {
        configurationmapping "*->*,!sources,!javadoc"
    }
    runtime 'org.codehaus.jackson:jackson-mapper-asl:1.7.9' {
        configurationmapping "*->*,!sources,!javadoc"            
    }

I'm not sure whether all of these steps were necessary, but they allowed us to move forward.



来源:https://stackoverflow.com/questions/9797680/grails-refresh-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!