Eclipse downloadTest

What is the way to fetch test jars from maven repository? If I wanted to fetch javadocs or sources for a jar in repository, I would put the following in build.gradle file:

eclipse {
    classpath {
        downloadJavadoc = true
        downloadSources = true

Ideally, getting the test jars would require just adding downloadTest = true, but it doesn’t work that way. So how does one achieve that? For an example of test (and other) jars, see here.

I’m guessing you need this to be able to jump to sources from the editor. That should work out of the box. I did a quick check with the dependency you linked above and it works even without configuring eclipse.classpath.

Thank you your reply! What you are indicating is correct for the files coming from the sources jars. I am trying to find a way to make the test jars available in the same way(mechanism). Right now, my solution was to copy the test jar I need undertow-core-2.0.26.Final-tests.jar in a temporary directory in the project:

Doing so feels wrong and hence this post. Here is an example of few classes that live in the test jar that I use in my testcases:


To possibly reach more people who might know about this, I also posted the question on stackoverflow. If/when we have a solution, we can put it there too.

To be frank, I misunderstood your question a bit. You can add the dependency to the tests with the following notation.

dependencies {

Thank you Donat! As promised, I’ve posted your answer in stackoverflow as well.