In order to do so I need elipse-wtp, which in turn requires either the ear or war plugin,
It doesn’t require either, but will perform additional configuration if either of them is present.
When I issue a build an ear artifact is created.
This will only happen if you applied the ‘ear’ plugin.
I guess this would work …
Are you trying to get an Ear-like Eclipse configuration without actually producing an Ear? Then this might be the way to go. However, ‘build.dependsOn ear/jar’ is redundant and can be removed.
The wtp-eclipse plugin won’t let me configure wtp.facets if the ear or war plugins are not applied
this is what I get:
FAILURE: Build failed with an exception.
* Where:
Script '/home/ssantoro/dev/ejlipse/evb/eclipse-client-jar.gradle' line: 41
* What went wrong:
A problem occurred evaluating script.
> No signature of method: org.gradle.plugins.ide.eclipse.model.EclipseWtp.facet() is applicable for argument types: (java.util.LinkedHashMap) values: [[type:fixed, name:java]]
Possible solutions: facet(groovy.lang.Closure), wait(), getFacet(), wait(long), each(groovy.lang.Closure), find()
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I’d rather not apply the ear plugin, but I have to in order to configure eclipse as I wish.
There is no ‘eclipse.wtp.facet(Map)’. It’s ‘eclipse.wtp.facet.facet(Map)’ (see the DSL reference). You don’t have to apply the ‘ear’ or ‘war’ plugin to get the ability to configure facets.
Apply the War or Ear plugin * Manually add and configure a GenerateEclipseWtpFacet task
It might be a good idea to make the eclipse-wtp plugin always add a GenerateEclipseWtpFacet task and to always initialize eclipse.wtp.facet to a non-null value.
Use the “gradle.projectsEvaluated” configuration closure (as eclipse-wtp tasks are configurated within “project.gradle.projectsEvaluated” in “org.gradle.plugins.ide.eclipse.EclipseWtpPlugin”):
Edit: The best is using the configuration closure at the end of your project such that all internal closures are already executed (still kind of ugly and no gradle style …)
since my reply, I have also created an already applied pull request fixing this topic. The fix weill be delivered with Gradle v2.3 (which is hopefully coming soon ).
since my reply, I have also created an already applied pull request fixing this topic. The fix weill be delivered with Gradle v2.3 (which is hopefully coming soon ).
since my reply, I have also created an already applied pull request fixing this topic. The fix weill be delivered with Gradle v2.3 (which is hopefully coming soon ).