9

Before we started using Gradle, a multi-project (10-12) development effort within Eclipse successfully deployed, via a WTP project, to one of the internal Tomcat 7 servers. We find this very useful for development.

With Gradle up and running the dependent project's jar files are no longer being copied to the ../WEB-INF/lib directory. I don't believe this has anything to do with gradle as it is completely out of the picture later on, but it is different, so I am mentioning it. Building the standalone war file works perfectly as does "gradle jettyRun".

If I add the project facet "Utility Module" to the dependent projects within Eclipse then it works. However, I don't recall that this was ever done initially. Ok, this also really complicates the generation of the eclipse projects from gradle as well!

I can live with it, but was wondering if anyone knew if it has to be this way or if there is some alternative.

Thanks - versions: eclipse Indigo SR2, Java 1.7, Gradle 1.2

JoeG
  • 7,191
  • 10
  • 60
  • 105
  • Are you using Gradle's Eclipse plugin or the [STS Gradle tooling](https://github.com/SpringSource/eclipse-integration-gradle)? Have you tried with the latter? – Peter Niederwieser Sep 19 '12 at 11:31
  • Using the STS Gradle tooling version 3.0.somethingLong. However, am not running "gradle tasks" from within eclipse. Just doing the "normal" Run As --> Run on Server – JoeG Sep 19 '12 at 12:20

1 Answers1

13

I've run into this problem as well: An Eclipse WTP project that depends on other projects won't deploy those projects' dependencies unless they are WTP projects as well.

This is far from an ideal solution, but in my own build scripts, I work around this by using the eclipse-wtp plugin instead of the eclipse plugin:

allprojects {
    apply plugin: 'eclipse-wtp'
}

There are a couple of bugs related to this: GRADLE-1880 and STS-2192.

Brant Bobby
  • 14,956
  • 14
  • 78
  • 115
  • Sorry - took a little while for me to get time to validate this - this DOES work! Thanks a lot! – JoeG Sep 26 '12 at 12:28
  • Also works for me, my not web project in my multi-project web project was showing up as a war. Trick above + re importing the projects into eclipse did do the trick – dr jerry Dec 06 '13 at 21:12
  • In my case I've added the plugin for the web project, and on eclipse added the "Java build path entries" and "The project" on "Deployment Assembly" – camposer Apr 28 '16 at 05:33