Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Last active March 27, 2016 00:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ysb33r/8d2058b706aebe89a530 to your computer and use it in GitHub Desktop.
Ivy Ant cannot download from Rubygems Maven proxies
// This ivery simplistic code example illustrates that Groovy Grapes suffers from the same problem
@GrabResolver('http://rubygems.lasagna.io/proxy/maven/releases/')
@Grab('rubygems:colorize:0.7.6@gem')
import java.io.File
true
def ivyAnt = new AntBuilder()
ivyAnt.taskdef name: "testConfigure",
classname: 'org.apache.ivy.ant.IvyConfigure'
ivyAnt.taskdef name: "testResolve",
classname: 'org.apache.ivy.ant.IvyResolve'
File root = new File('FOO')
File cache = new File(root,'cache')
File resolution = new File(root,'resolution')
File cfg = new File(root,'test-ivysettings.xml')
root.mkdirs()
cfg.text = """<ivysettings>
<settings defaultResolver='foo'/>
<caches defaultCacheDir='${cache.absolutePath}'
artifactPattern='[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'
ivyPattern='[organisation]/[module]/[revision]/ivy-[revision].xml'
resolutionCacheDir='${resolution.absolutePath}'/>
<resolvers>
<chain name="foo" returnFirst="true">
<ibiblio name='rubygems' m2compatible='true' root='http://rubygems.lasagna.io/proxy/maven/releases'/>"
</chain>
</resolvers>
</ivysettings>
"""
ivyAnt.testConfigure file : cfg.absolutePath
ivyAnt.testResolve (
inline : true,
organisation: 'rubygems', module: 'colorize', revision: '0.7.7',
transitive:true,
type : '*',
conf : '*'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment