4

I have a root project(web-app) with 2 included builds(core and models) in my eclipse workspace and I want to start the web-app in eclipse-tomcat.

settings.gradle of web-app:

rootProject.name = 'web-app'

includeBuild  '../core'
includeBuild  '../models'

The documentation says that gradle composite builds don't work with eclipse-wtp: https://blog.gradle.org/announcing-buildship-2.0

Applying the eclipse-wtp plugin to the included builds(core and models) helps a lot. Without this the core and models.jar won't be included in the wtpwebapps/web-app/WEB-INF/lib folder.

The models project is a JPA project and must be enhanced. This is done with a gradle task in the models project and works if the models project is build "standalone" or with the composite build of the root project(war).

If I look at the wtpwebapps/web-app/WEB-INF/lib folder I can see that the models project is not enhanced, it looks like the models.jar is just a compiled version of the models project from the eclipse workspace.

The correct jar file with enhancement would be in models/build/libs. I am looking for a workaround to get this fixed, for example configure the eclipse-wtp task of models project somehow like

eclipse{
    wtp{
        component {
           resource sourcePath /build/libs deployPath /WEB-INF/lib
        }
    }
}

I am not so familiar with the eclipse wtp configuration so maybe someone can help to create a workaround for the buildship composite build limitation.

soilworker
  • 1,317
  • 1
  • 15
  • 32
  • You do NOT have submodules, you have created a [Composite Build](https://docs.gradle.org/current/userguide/composite_builds.html) which includes two other builds. This is NOT the same as a [multi project build](https://docs.gradle.org/current/userguide/multi_project_builds.html) – lance-java Nov 13 '17 at 16:29
  • 1
    Maybe the terms I used are wrong, but the problem is the same. I have edited my question. – soilworker Nov 14 '17 at 08:49
  • Looks like you might be on the right track - your gradle snippet is only a couple of colons and a comma from being perfectly valid. Could you elaborate on what *enhancement* means in this context? Are you trying to build a fat jar but it comes out skinny? Are you expecting transitive dependencies to be pulled into your .WAR automatically, but they're not? – Mike Patrick Nov 18 '17 at 22:23
  • Enhancement means OpenJPA byte code enhancement. I don't mean building a war file. I mean eclipse-wtp with a tomcat server:/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps... In the lib folder I can find the core and model project, but the model project is not byte code enhanced. – soilworker Nov 20 '17 at 14:45
  • [Meanwhile](https://docs.gradle.org/current/userguide/composite_builds.html#composite_build_ide_integration): "In addition to these Gradle plugins, recent versions of IntelliJ IDEA and Eclipse Buildship support direct import of a composite build." – Markus Pscheidt Feb 06 '18 at 09:25
  • 1
    "Applying the eclipse-wtp plugin to the included builds(core and models) helps a lot." Even your question solved my problem. Thanks a lot @soilworker – User Aug 16 '18 at 12:55

0 Answers0