How to set a sequence for Dependencies?


(Ravi) #1

Hello,

I am looking to download dependencies in sequence using build.gradle.
It seems Gradle always go with Jar files first which we added under project class path folder and after that it will go with the online dependencies but i want do it other way.

The reason behind is, i have same package names in 2 different jars. so when I run my jar using Gradle it will take the class from jars instead of classes from online dependencies but when I remove that jar dependency from Gradle and if i add same jar using IDE my code works fine because at that time the order is online dependencies first and jar at the end.

I know there is a way to do this in maven but not sure about Gradle.

Please help me with this.

dependencies{

    testCompile 'org.testng:testng:6.10'
    testCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.4.0'
    testCompile group: 'log4j', name: 'log4j', version: '1.2.17'
    testCompile group: 'org.json', name: 'json', version: '20080701'
    testCompile 'org.apache.cxf:cxf-rt-rs-client:3.0.0'
    testCompile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
    compile 'org.apache.httpcomponents:httpclient:4.5.2'
    compile group: 'com.opencsv', name: 'opencsv', version: '3.3'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-firefox-driver', version: '3.0.1'
    testCompile files("executables/ojdbc6.jar")
    testCompile files("executables/jwt-generator.jar")

}

Thanks,

Ravi