开发者

Is it possible to use predefined ivysettings.xml from a grails app

开发者 https://www.devze.com 2023-02-05 04:18 出处:网络
Today we use ivy for our existing Java projects.We are looking at adding a grails application.I have found how to set up the BuildConfig.groovy to use our repos. However we have all of this informatio

Today we use ivy for our existing Java projects. We are looking at adding a grails application. I have found how to set up the BuildConfig.groovy to use our repos. However we have all of this information defined in a shared ivysettings.xml file for all of our Java apps, is it possible to tell Grails to use the d开发者_如何学Pythonefault resolver from that ivysettings file?


You can do something like this in BuildConfig.groovy (example found from Users mailing list)

repositories {
    resolver sandboxResolver()
}

private DependencyResolver sandboxResolver() {  
    def ivySettings = new IvySettings()
    ivySettings.load(new File("C:\myivysettingsfile.xml")) //You also can pass a  URL object here
    def ivyResolver = ivySettings.getDefaultResolver()
    return ivyResolver
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号