Missing (eclipse) inter-project dependencies for gradle multi-module build
Expected Behavior
For the example at https://github.com/aanno/Servlet-4.0-Sampler/tree/report/eclipse-buildship-jee (branch: report/eclipse-buildship-jee), I expect buildship to set up the eclipse inter-project dependencies but it does not.
Current Behavior
Buildship does not set up any (eclipse) inter-project dependency that are expressed in the multi-module gradle build.
Context
Multi-mpdule dependencies in my example are as follows:
- ejb2 -dependsOn-> ejb1
- war -dependsOn-> ejb2
- ear -deployDependsOn-> ejb1, ejb2, war
Steps to Reproduce
Use my example and import it as gradle project into eclipse/buildship.
Your Environment
gradle build scan URL: https://gradle.com/s/vexbbemydkbfs
Any news on this? I'm getting hit by the same issue, and I can't find a workaround either...
Found a dirty workaround:
task fixClasspath {
doLast {
file(".classpath").withWriter { writer ->
new groovy.xml.MarkupBuilder(new IndentPrinter(writer, " ", true)).classpath {
classpathentry(kind:"src", path:"/ap")
}
}
}
}
eclipseJdtApt.dependsOn fixClasspath
This will create a .classpath file with the dependency on the "ap" project. buildship will merge the .classpath file properly, making eclipse have a dependency on the ap project. Maybe it helps someone.
You can do the workaround in the eclipse.classpath.file.whenMerged block as well.
In the ear project, you probably need to add the deploy dependency scope to eclipse.classpath.plusConfigurations.
You can do the workaround in the
eclipse.classpath.file.whenMergedblock as well.
I tried and tried and it simply didn't work. How does it work for you?
You can find a couple of examples here: https://discuss.gradle.org/t/buildship-1-0-18-is-now-available/19012
At the same time, the solution with eclipse.classpath.plusConfigurations is more preferable imho.
As I said, I tried that and it didn't work.