buildship icon indicating copy to clipboard operation
buildship copied to clipboard

Composite build does not generate facets for included projects (Eclipse JEE 20191212-1212, Gradle 6.0.1)

Open maciejmiklas opened this issue 5 years ago • 3 comments

It seams that Buildship does not support this functionality: https://docs.gradle.org/current/userguide/composite_builds.html#separate_composite I've prepared a test project that can be used to reproduce this problem: https://github.com/maciejmiklas/eclipse_buildship

We have a simple Wicket web application in eclipse_buildship/my_webapp. It references a lib from eclipse_buildship/my_lib. Both project can be developed separately, so the my_webapp references the lib over compile ('org.test:my_lib:1.0.0-SNAPSHOT')

Now I would like to develop the web application and the lib in one workspace without modifying existing build files. In order to archive it I've created composite project in eclipse_buildship\eclipse_buildship that includes both projects:

rootProject.name = 'eclipse_buildship'

includeBuild '../my_lib'
includeBuild '../my_webapp'

The build itself is correct. I can create war on command line (there is war task for it). Importing into IntellJ works also as expected, only eclipse does not work.

Importing into eclipse works fine, but it does not generate facets for imported projects. Therefore war cannot be deployed into tomcat. I could execute WTP task from command line and it would enable web nature for my_webapp, but such deployment does not contain my_lib from the workspace.

I understand, that it's possible to migrate my_webapp into composite build, but this is very inconvenient and would require modification of build files. This might work for hello-world-projects, but in real live we have multiple projects of different nature in one workspace, so it's had to decide which project should be composite and which one not. Not mentioning the fact, that we would have to determine what includes such composite project should have.

In this case one composite project pro workspace that includes all projects is a way to go.

maciejmiklas avatar Feb 04 '20 10:02 maciejmiklas

I've tracked down the root cause. It seems that Buildship ignores included builds when calling the eclipseWtp task.

Buildship has only basic support for WTP projects. In any case, I'll try to provide a fix in the near future.

FYI, I know that the workspace composite feature is being developed by an external contributor, it may be helpful for you.

donat avatar Mar 12 '20 09:03 donat

Same problem here. We would like to separate our large multiproject build into separate standalone component-builds and link them together by included-builds. This bug finally stopped us from doing the expected reorganisation as Eclipse is the main IDE used and run/debug out of Eclipse is essential in the development process in our team.

didierschlegel avatar May 16 '22 07:05 didierschlegel

Can't anyone find a solution to this problem? It's a shame to have to change IDE just because of this bug.

legrottagliegionata avatar Apr 05 '24 09:04 legrottagliegionata