Keep custom project facets when refreshing a project that applies eclipse-wtp plugin
This is somewhat a follow up to #392. The same logic to "keep what you don't manage" should be applied to Eclipse WTP project facets (in the component file) that are not among the ones handled to configure java and war projects.
As a concrete example, I have some WTP projects that use the JPA facet or the JavaScript facet and whenever I refresh my Gradle project with Buildship 2.1.1, those facets are removed.
Yes, once again I may tweak the build script to re-add those facets, but I think they should not be managed by Buildship, since they are related to IDE tooling configuration and not to project building/deploying/running.
I just made some tests and I think that the current behaviour is the consequence of calling the cleanEclipseWtpFacet task before the eclipseWtpFacet task, as described here to solve a previous bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=506627#c1
In fact, if I manually invoke the eclipseWtpFacet task from the command line, Gradle by itself does not remove my other facets (like JPA or JavaScript).
We'd need some deeper integration with WTP to solve this properly. The way I imagine this working would be to only remove old facets that were actually added by Gradle, similar to what we do with Natures and Builders. For that to work, we'll need to model WTP more strongly instead of just calling the task.
Calling the task was always just a workaround, though one that works pretty well for the 80% case. Let's prioritize this along other popular feature requests after #354 and #211 are done.
I meet that problem too. When using gradle with WTP, a gradle refresh sets back the dynamic web module facet to 2.4 instead of 6.0 before the refresh, which is quite annoying since those facets are not in the same namespace.