Search This Blog

Saturday, June 14, 2014

How to download the source code of test jars using Gradle

I just faced a problem while trying downloading the source code of some of test jars. You just need to specify "test-sources" into your classifier.

For example:

compile group:'org.xyz', name:'your-target-main-jar', version:'jar-version', classifier: 'test-sources'

This will download your target main jar (of course with its dependencies) and its test jar associated with the source code.

Also if you are using eclipse, you will need to add the following:

eclipse {
    classpath {
       downloadSources=true
    }
}