This no longer works in Gradle 2.3 because the facet method adds facets instead of updating them. I couldn’t get @jnizet’s suggested workaround to work either. I’m not even sure how to do this in Gradle 2.3.
Ah, it’s merging existing .settings files too. So if you generate a bad .settings/org.eclipse.wst.common.project.facet.core.xml (with jst.web 2.4), even with my bit of code, it’ll retain both versions. If you clean the .settings directory, that doesn’t happen.
You’re right, I cleaned the .settings directory and ran gradle eclipse and it generated fine with your code. Thanks.
I still wouldn’t call this easy, though. Could Gradle support overriding a default facet version somehow? Maybe the facet() method could override an existing facet with the same name?
Definitely agree with David on this one. Applying a facet should replace an existing facet with the same name.
The behavior has changed recently (can’t remember when). In the old days, setting any facet would clear all default facets and you would start from a clean slate. This was already a pain since it meant you had to recreate everything gradle does out of the box if you want a different facet version. The new behavior is only different, not better.