Obviously I am not a Maven nor Ivy expert, but could it be that the jruby-core Maven project has not been "properly" constructed or are we looking at a possible Ivy limitation here?
Thanks, Colin On Tue, Jun 25, 2013 at 8:22 AM, Marc De Boeck <[email protected]> wrote: > I think that ivy doesn't recognize the "native" classifier. > I've set your chained resolver in my ivysettings file and executed the > ant-task "ivy:install" to copy the artifacts to my own local repository. > But the "native" jar wasn't installed this way either. > It's even worse, because when installing jruby-core with transitive=true, I > don't get the javadoc and sources either (only the jar file). When I > "install" directly the jffi artifact, then javadoc and sources are > installed properly and copied to my local repository. The "native" jar > however is not copied in both cases. > > Marc > > > > 2013/6/24 Colin Surprenant <[email protected]> > >> sure, my environment is JRuby using Rake/Ant integration and Ivy 2.3.0 >> >> my Ivy setting file is quite simple: >> >> <?xml version="1.0"?> >> <ivysettings> >> <settings defaultResolver="repositories"/> >> <resolvers> >> <chain name="repositories"> >> <ibiblio name="ibiblio" m2compatible="true"/> >> <ibiblio name="maven2" >> root="http://repo.maven.apache.org/maven2/" m2compatible="true"/> >> <ibiblio name="sonatype" >> root="http://repo.maven.apache.org/maven2/" m2compatible="true"/> >> <ibiblio name="clojars" root="http://clojars.org/repo/" >> m2compatible="true"/> >> </chain> >> </resolvers> >> </ivysettings> >> >> to retrieve the dependencies I use the Ant/Ivy retrieve statement, >> which in Rake/Ant is this: >> >> ant.resolve 'file' => IVY_TOPOLOGY_DEPENDENCIES >> ant.retrieve 'pattern' => >> >> "#{TARGET_DEPENDENCY_DIR}/topology/[conf]/[artifact]-[type](-[classifier])-[revision].[ext]", >> 'conf' => 'runtime' >> ant.retrieve 'pattern' => >> >> "#{TARGET_DEPENDENCY_DIR}/topology/[conf]/[artifact]-[type](-[classifier])-[revision].[ext]", >> 'conf' => 'compile' >> >> So, here I tried to explicit both retrieves on conf runtime/compile. >> >> The IVY_TOPOLOGY_DEPENDENCIES contains mostly what I described in my >> previous email, either >> >> 1- which works but doesn't feel like the right way to do this >> >> <?xml version="1.0"?> >> <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> >> <info organisation="redstorm" module="topology-deps"/> >> >> <dependencies> >> <dependency org="org.jruby" name="jruby-core" rev="1.7.4" >> conf="default" /> >> <dependency org="com.github.jnr" name="jffi" rev="1.2.5" >> conf="default"> >> <artifact name="jffi" type="jar" /> >> <artifact name="jffi" type="jar" m:classifier="native"/> >> </dependency> >> </dependencies> >> </ivy-module> >> >> 2- which does not work (retrieving jffi-native): >> >> <?xml version="1.0"?> >> <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> >> <info organisation="redstorm" module="topology-deps"/> >> >> <dependencies> >> <dependency org="org.jruby" name="jruby-core" rev="1.7.4" >> conf="compile->default" transitive="true" /> >> <dependency org="org.jruby" name="jruby-core" rev="1.7.4" >> conf="runtime->default" transitive="true" /> >> </dependencies> >> </ivy-module> >> >> Colin >> >> On Mon, Jun 24, 2013 at 3:36 PM, Marc De Boeck <[email protected]> wrote: >> > Could give a little bit more information about your environment ? >> > For example: >> > how does your ivysettings file look like ? >> > What command do you use to "fetch" these dependencies ? (please provide >> an >> > extract of your build file). >> > >> > Regards, >> > Marc >> > >> > >> > >> > 2013/6/24 Colin Surprenant <[email protected]> >> > >> >> Hi, >> >> >> >> I am having troubles finding the "right way" to fetch some "native" >> >> dependencies with Ivy and I am hoping someone can point me in the >> >> right direction. >> >> >> >> My project has a dependency on the org-jruby:jruby-core artifact >> >> http://mvnrepository.com/artifact/org.jruby/jruby-core/1.7.4. One of >> >> the jruby-core dependency is com.github.jnr:jffi >> >> http://mvnrepository.com/artifact/com.github.jnr/jffi/1.2.5 and jffi >> >> has also a "native" artifact which I need to fetch. >> >> >> >> By default, specifying a transitive dependency on jruby-core does not >> >> fetch the jffi-native artifact, just the "compile" scope jar file. >> >> jffi-native is in the "runtime" scope and so far the only way I was >> >> able to fetch it is using this dependency declaration: >> >> >> >> <dependency org="com.github.jnr" name="jffi" rev="1.2.5" conf="default"> >> >> <artifact name="jffi" type="jar" /> >> >> <artifact name="jffi" type="jar" m:classifier="native"/> >> >> </dependency> >> >> >> >> I tried using Ivy conf for compile and runtime but it does not fetch >> >> jffi-native. here's what I tried: >> >> >> >> <configurations> >> >> <conf name="compile" visibility="public" description="default >> >> dependencies" /> >> >> <conf name="runtime" visibility="public" description="runtime >> >> dependencies" /> >> >> </configurations> >> >> >> >> <dependencies> >> >> <dependency org="org.jruby" name="jruby-core" rev="1.7.4" >> >> conf="compile->default" transitive="true" /> >> >> <dependency org="org.jruby" name="jruby-core" rev="1.7.4" >> >> conf="runtime->default" transitive="true" /> >> >> </dependencies> >> >> >> >> When looking at the mvm dependency:tree we can see >> >> com.github.jnr:jffi:jar:native:1.2.7:runtime in the "runtime" scope. >> >> >> >> INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ jruby-core >> --- >> >> [INFO] artifact com.github.jnr:jffi: checking for updates from central >> >> [INFO] artifact com.github.jnr:jnr-x86asm: checking for updates from >> >> central >> >> [INFO] org.jruby:jruby-core:jar:1.7.4 >> >> [INFO] +- org.jruby:jruby-stdlib:jar:1.7.4:compile >> >> [INFO] +- org.jruby.joni:joni:jar:2.0.0:compile >> >> [INFO] +- com.github.jnr:jnr-netdb:jar:1.1.2:compile >> >> [INFO] +- com.github.jnr:jnr-enxio:jar:0.4:compile >> >> [INFO] +- com.github.jnr:jnr-unixsocket:jar:0.3:compile >> >> [INFO] +- com.github.jnr:jnr-posix:jar:2.5.2:compile >> >> [INFO] +- org.jruby.extras:bytelist:jar:1.0.10:compile >> >> [INFO] +- com.github.jnr:jnr-constants:jar:0.8.4:compile >> >> [INFO] +- org.jruby.jcodings:jcodings:jar:1.0.10:compile >> >> [INFO] +- com.github.jnr:jffi:jar:1.2.5:compile >> >> [INFO] +- org.yaml:snakeyaml:jar:1.11:compile >> >> [INFO] +- jline:jline:jar:2.7:compile >> >> [INFO] +- joda-time:joda-time:jar:2.1:compile >> >> [INFO] +- com.jcraft:jzlib:jar:1.1.2:compile >> >> [INFO] +- com.headius:invokebinder:jar:1.2:compile >> >> [INFO] +- com.github.jnr:jnr-ffi:jar:1.0.4:compile >> >> [INFO] | +- com.github.jnr:jffi:jar:native:1.2.7:runtime >> >> [INFO] | \- com.github.jnr:jnr-x86asm:jar:1.0.2:compile >> >> [INFO] +- junit:junit:jar:4.7:test >> >> [INFO] +- bsf:bsf:jar:2.3.0:provided >> >> [INFO] \- org.apache.ant:ant:jar:1.7.0:provided >> >> [INFO] \- org.apache.ant:ant-launcher:jar:1.7.0:provided >> >> >> >> I do not understand exactly why >> >> com.github.jnr:jffi:jar:native:1.2.7:runtime is not fetched when using >> >> the "runtime" conf with Ivy. What am I missing here? What would be the >> >> correct way to do this? >> >> >> >> Thanks, >> >> Colin >> >> >> >> >> >> -- >> @colinsurprenant >> -- @colinsurprenant
