# Class EclipseWtpFacet

java.lang.Object
org.gradle.plugins.ide.eclipse.model.EclipseWtpFacet

@Deprecated public abstract class EclipseWtpFacet extends Object
Deprecated.
Will be removed in Gradle 10.
Enables fine-tuning wtp facet details of the Eclipse plugin

Advanced configuration closures beforeMerged and whenMerged receive `WtpFacet` object as parameter.

    plugins {
        id 'war' // or 'ear' or 'java'
        id 'eclipse-wtp'
    }

    eclipse {
      wtp {
        facet {
          //you can add some extra wtp facets or update existing ones; mandatory keys: 'name', 'version':
          facet name: 'someCoolFacet', version: '1.3'

          file {
            //if you want to mess with the resulting XML in whatever way you fancy
            withXml {
              def node = it.asNode()
              node.appendNode('xml', 'is what I love')
            }

            //beforeMerged and whenMerged closures are the highest voodoo for the tricky edge cases.
            //the type passed to the closures is WtpFacet

            //closure executed after wtp facet file content is loaded from existing file
            //but before gradle build information is merged
            beforeMerged { wtpFacet ->
              //tinker with WtpFacet here
            }

            //closure executed after wtp facet file content is loaded from existing file
            //and after gradle build information is merged
            whenMerged { wtpFacet ->
              //you can tinker with the WtpFacet here
            }
          }
        }
      }
    }

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EclipseWtpFacet(XmlFileContentMerger file)`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `facet(Map<String,?> args)`
  Deprecated.
  Adds a facet.
  `void`
  `file(Closure closure)`
  Deprecated.
  Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information
  `void`
  `file(Action<? super XmlFileContentMerger> action)`
  Deprecated.
  Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information.
  `List<Facet>`
  `getFacets()`
  Deprecated.
  The facets to be added as elements.
  `XmlFileContentMerger`
  `getFile()`
  Deprecated.
  See `file(Action)`
  `void`
  `mergeXmlFacet(WtpFacet xmlFacet)`
  Deprecated.
  Merge xml facet.
  `(package private) List<Facet>`
  `replaceInconsistentFacets(List<Facet> facets)`
  Deprecated.
  Removes incompatible facets from a list of facets.
  `void`
  `setFacets(List<Facet> facets)`
  Deprecated.
  Sets the facets.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EclipseWtpFacet

    @Inject public EclipseWtpFacet(XmlFileContentMerger file)
    Deprecated.

- ## Method Details

  - ### getFile

    public XmlFileContentMerger getFile()
    Deprecated.
    See `file(Action)`
    Since:
      1.0

  - ### file

    public void file(@DelegatesTo(XmlFileContentMerger.class) Closure closure)
    Deprecated.
    Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information

    The object passed to whenMerged{} and beforeMerged{} closures is of type `WtpFacet`

    For example see docs for `EclipseWtpFacet`

    Since:
      1.0

  - ### file

    public void file(Action<? super XmlFileContentMerger> action)
    Deprecated.
    Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information.

    For example see docs for `EclipseWtpFacet`

    Since:
      3.5

  - ### getFacets

    public List<Facet> getFacets()
    Deprecated.
    The facets to be added as elements.

    For examples see docs for `EclipseWtpFacet`

    Since:
      1.0

  - ### setFacets

    public void setFacets(List<Facet> facets)
    Deprecated.
    Sets the facets.
    Since:
      1.0

  - ### facet

    public void facet(Map<String,?> args)
    Deprecated.
    Adds a facet.

    If a facet already exists with the given name then its version will be updated.

    In the case of a "jst.ejb" facet, it will also be added as a fixed facet.

    For examples see docs for `EclipseWtpFacet`

    Parameters:
      `args` - A map that must contain a 'name' and 'version' key with corresponding values.
    Since:
      1.0

  - ### replaceInconsistentFacets

    List<Facet> replaceInconsistentFacets(List<Facet> facets)
    Deprecated.
    Removes incompatible facets from a list of facets.

    Currently removes the facet "jst.utility" when the facet "jst.ejb" is present.

    Parameters:
      `facets` - , a list of facets
    Returns:
      the modified facet list

  - ### mergeXmlFacet

    public void mergeXmlFacet(WtpFacet xmlFacet)
    Deprecated.
    Merge xml facet.
    Since:
      1.0