How to get ivy artifacts with custom configurations added to compile path


(Lloyd Gomes) #1

I have an artifacts defined in ivy as

<dependency org="com.mycompany" name="ti-utilities" rev="mystatus.${overridable.ivy.status}.[1.3,2)" conf="java-main-compile-runtime->java-main-provides"/>

I’ve converted this into

dependencies {
 compile group: "com.mycompany", name: "ti-utilities", version: "mystatus.${ivyStatus}.[1.3,2)", configuration: "java-main-compile-runtime"

when I run a dependency check everything works fine but the artifact above is not added to the compile classpath

here is a partial result of the build

Visiting configuration com.google.code.findbugs:annotations:1.3.9(default). Visiting configuration org.slf4j:slf4j-api:1.5.10(default). Attaching com.mycompany:service-lang:8.0(compile) to its parents. Attaching com.mycompany:ti-utilities:1.6.20140630164337(java-main-compile-runtime) to its parents. Attaching com.google.code.findbugs:annotations:1.3.9(default) to its parents. Attaching org.slf4j:slf4j-api:1.5.10(default) to its parents. Found artifact ‘com.google.code.findbugs:annotations:1.3.9:annotations.jar’ in resolver cache: C:\Users\lgs.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\annotations.3.9\edeabc3a0f1eb53d115bfea725c7ea21ce5e5c71\annotations-1.3.9.jar Found artifact ‘org.slf4j:slf4j-api:1.5.10:slf4j-api.jar’ in resolver cache: C:\Users\lgs.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api.5.10\cbe2371e467af56f350edfbdd87f5b75981fefe3\slf4j-api-1.5.10.jar Compiler arguments: -d D:\ws\hg\ng-svc\ng-svc\service-lang\build\classes\main -g -classpath C:\Users\lgs.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\annotations.3.9\edeabc3a0f1eb53d115bfea725c7ea21ce5e5c71\annotations-1.3.9.jar;C:\Users\lgs.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305.3.90719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf\jsr305-1.3.9.jar;C:\Users\lgs.gradle\caches\modules-2\files-2.1\commons-lang\commons-lang.46313e02a793435009f1e458fa4af5d879f6fb11\commons-lang-2.4.jar;C:\Users\lgs.gradle\caches\modules-2\files-2.1\commons-io\commons-io.4\b1b6ea3b7e4aa4f492509a4952029cd8e48019ad\commons-io-2.4.jar;C:\Users\lgs.gradle\caches\modules-2\files-2.1\commons-codec\commons-codec.4216af16d38465bbab0f3dff8efa14204f7a399a\commons-codec-1.4.jar;C:\Users\lgs.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api.5.10\cbe2371e467af56f350edfbdd87f5b75981fefe3\slf4j-api-1.5.10.jar D:\ws\hg\ng-svc\ng-svc\service-lang\src\main\java\com\mycompany\i18n\LocalizedException.java …

you can see that the utilities get resolved but I’m unclear why they aren’t added to classpath during compile, I suspect it has something to do with the configuration name.


#2

I think you want your dependency to point to the ‘java-main-provides’ configuration.


(Lloyd Gomes) #3

Thanks daz that did the trick