Eclipse plugin - No sources and javadoc included from library

Hi everybody

I’m experiencing some troubles with my gradle - eclipse plugin. I have the following multi project structure:

  • workspace
    • Project1
      • build.gradle
      • library
        • example.jar
        • example-sources.jar
  • build.gradle

Following file is my build.gradle for the whole multi project:

subprojects {
	apply plugin: 'application'
	apply plugin: 'eclipse'

	repositories {
		mavenCentral()
	}

	dependencies {
		compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
		testCompile 'junit:junit:4.11'
	}

	sourceCompatibility=System.properties['java.specification.version']
	version = '1.15.07.1-SNAPSHOT'
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.2'
}

Following file is the build.gradle for Project1:

apply plugin: 'java'

applicationName = "Project1"
mainClassName = "ch.path.to.mainClass"

dependencies {
	compile project(':Project2')
	compile fileTree(dir: 'library', include: ['*.jar'])
}

So I can use the libraries from the “library”-folder, that’s not a problem. But when I try to view a class or display the javadoc, then following error message is displayed:

the jar of this class file belongs to container 'gradle dependencies' which does not allow modifications to source attachments on its entries.

How can I add local sources and javadoc to my jar?

Kind regards
Marc