# EclipseWtpFacet

API Documentation: | `EclipseWtpFacet`

Enables fine-tuning wtp facet details of the Eclipse plugin

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

    apply plugin: 'java'
    apply plugin: 'war'
    apply plugin: 'eclipse-wtp'

    eclipse {
      wtp {
        facet {
          //you can add some extra wtp facets; 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
            }
          }
        }
      }
    }

### Properties

Property | Description
`facets` | The facets to be added as elements.
`file` | See `EclipseWtpFacet.file{}`

### Property details

#### ``List`<`Facet`>` `facets`

The facets to be added as elements.

For examples see docs for `EclipseWtpFacet`

Default with `eclipse` and `war` plugins:
  Java and web facets.

#### `XmlFileContentMerger` `file` (read-only)

See `EclipseWtpFacet.file{}`

### Script blocks

Block | Description
`file` | Enables advanced configuration like tinkering with the output xml or affecting the way existing wtp facet file content is merged with gradle build information

### Script block details

#### `file` { }

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`

Delegates to:
  `XmlFileContentMerger` from `file`

### Methods

Method | Description
`facet(args)` | Adds a facet.

### Method details

#### `void` `facet`(``Map`<`String`, ?>` args)

Adds a facet.

For examples see docs for `EclipseWtpFacet`