[GRADLE-2221] Cannot manually configure a facet for eclipse-wtp plugin unless War or Ear plugin is applied Created: 10/Apr/12 Updated: 12/Dec/14 Resolved: 05/Dec/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 2.3-rc-1 |
Type: | Improvement | ||
Reporter: | Gradle Forums | Assignee: | Radim Kubacki |
Resolution: | Fixed | Votes: | 4 |
Issue Links: |
|
Description |
Hi, I am trying to create eclipse projects for my ejb artifacts. In order to do so I need elipse-wtp, which in turn requires either the ear or war plugin, When I issue a build an ear artifact is created. Now I have tried to silence it with the following: task ear(overwrite: true, dependsOn: jar) << { which does build the jar that I require, but it still builds the ear though. Any way I can configure the build task to not build the ear? Thanks Ciao BTW the eclipse plugin keeps printing this warning: |
Comments |
Comment by Gradle Forums [ 10/Apr/12 ] |
I guess this would work ... ear.onlyIf { false }build.dependsOn jar |
Comment by Gradle Forums [ 10/Apr/12 ] |
> the eclipse plugin keeps printing this warning: Sounds like you are configuring the `deployName` property on the wrong object. It's `eclipse.wtp.component.deployName = ...`. |
Comment by Gradle Forums [ 10/Apr/12 ] |
> 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. |
Comment by Gradle Forums [ 10/Apr/12 ] |
Hi, 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.
BUILD FAILED I'd rather not apply the ear plugin, but I have to in order to configure eclipse as I wish. |
Comment by Gradle Forums [ 10/Apr/12 ] |
There is no `eclipse.wtp.facet(Map)`. It's `eclipse.wtp.facet.facet(Map)` (see the [DSL reference]([1]http://gradle.org/docs/current/dsl/or.... You don't have to apply the `ear` or `war` plugin to get the ability to configure facets. |
Comment by Gradle Forums [ 10/Apr/12 ] |
This is the bit of eclipse dsl that did not work without applying the ear plugin: eclipse { project { classpath { jdt { wtp { facet { facet name: 'java', version: "1.6" file { Please let met me know if I did not do it correctly, and if not how may I configure facets without applying the ear plugin. Thanks! |
Comment by Gradle Forums [ 10/Apr/12 ] |
Please provide a self-contained runnable build script that demonstrates the problem. Otherwise I won't be able to help. |
Comment by Gradle Forums [ 10/Apr/12 ] |
Please find a self contained gradle project at [1]http://db.tt/Q4Vq3GpF I have commented out the apply plugin: 'ear' in the build.gradle file Thank You for your much appreciated offer to help Ciao |
Comment by Gradle Forums [ 10/Apr/12 ] |
Currently, your options are:
It might be a good idea to make the eclipse-wtp plugin always add a GenerateEclipseWtpFacet task and to always initialize eclipse.wtp.facet. |
Comment by Thorsten Möller [ 28/Apr/14 ] |
Comment by Andreas Schmid [ 26/Oct/14 ] |
Hi Stefano, |
Comment by Radim Kubacki [ 05/Dec/14 ] |
Fix provided by Andreas Schmid. |