IDEA plugin isn't downloading sources when mavenLocal() is used


(Jochen Mader) #1

I am trying to get downloading of sources to work with a multimodule project. Using the following entry gives me the correct IDEA-Project, except sources and javadoc aren’t being downloaded. Any idea why this doesn’t work?

Idea-Config

allprojects {
    apply plugin: 'maven'
    apply plugin: 'idea'
      idea {
        module {
            downloadJavadoc = true
            downloadSources = true
        }
    }
}

And my repo-config:

repositories {
        mavenLocal()
        mavenCentral()
        mavenRepo url: "http://repo.springsource.org/libs-milestone"
        mavenRepo url: "https://repository.apache.org/content/repositories/snapshots/"
        mavenRepo url: "http://source.mysema.com/maven2/releases/"
        mavenRepo url: "http://repo.maven.apache.org/maven2"
    }
      configurations {
        all*.exclude module: 'commons-logging'
    }

(Peter Niederwieser) #2

So you don’t get dependency sources in the IDE? Which exact steps are you taking?


(Jochen Mader) #3

The steps are: gradle build (just to make sure the project builds) gradle idea Then open idea and open existing project (I am NOT using the builtin Idea-Gradle-support). I can only jump into sources of libs that already are i my local Maven-Repo. No additional sources are being downloaded.


(Peter Niederwieser) #4

Usually this works fine. My best guess is that the problem is related to ‘mavenLocal()’. Why do you declare that repository?


(Jochen Mader) #5

Dang, here we go. After removing mavenLocal() half of the internet started flowing onto my disk :slight_smile: Now I got my sources. I was just hoping to keep as many of my dependencies as possible in one place.

Looks like I will have to live with that. Could be worse.

Thanks for the help!


(Peter Niederwieser) #6

I recommend to avoid ‘mavenLocal()’ because there are known issues with it. I’ve created GRADLE-2832 to track this one.


(Jochen Mader) #7

I guess I’ll just avoid it for the future :slight_smile: