# EclipseWtpComponent

API Documentation: | `EclipseWtpComponent`

Generates the org.eclipse.wst.common.component settings file for Eclipse WTP.

### Properties

Property | Description
`contextPath` | The context path for the web application
`deployName` | The deploy name to be used.
`inputFile` | The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.
`minusConfigurations` | The configurations whose files are to be excluded from dependent-module elements.
`outputFile` | The output file to write the final configuration to.
`plusConfigurations` | The configurations whose files are to be transformed into dependent-module elements.
`properties` | Additional property elements.
`resources` | Additional wb-resource elements.
`sourceDirs` | The source directories to be transformed into wb-resource elements.
`variables` | The variables to be used for replacing absolute path in dependent-module elements.

### Property details

#### `String` `contextPath`

The context path for the web application

Default with `eclipse` and `war` plugins:
  `project.war.baseName`

#### `String` `deployName`

The deploy name to be used.

Default with `eclipse` and `war` plugins:
  `project.name`

#### `File` `inputFile`

The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.

#### ``Set`<`Configuration`>` `minusConfigurations`

The configurations whose files are to be excluded from dependent-module elements.

Default with `eclipse` and `war` plugins:
  `[project.configurations.providedRuntime]`

#### `File` `outputFile`

The output file to write the final configuration to.

Default with `eclipse` and `war` plugins:
  ``${project.projectDir}`/.settings/org.eclipse.wst.common.component`

#### ``Set`<`Configuration`>` `plusConfigurations`

The configurations whose files are to be transformed into dependent-module elements.

Default with `eclipse` and `war` plugins:
  `[project.configurations.runtime]`

#### ``List`<`WbProperty`>` `properties`

Additional property elements.

Default with `eclipse` and `war` plugins:
  `[]`

#### ``List`<`WbResource`>` `resources`

Additional wb-resource elements.

Default with `eclipse` and `war` plugins:
  `[deployPath: '/', sourcePath: project.webAppDirName]`

#### ``Set`<`File`>` `sourceDirs`

The source directories to be transformed into wb-resource elements.

Default with `eclipse` and `war` plugins:
  source dirs from `project.sourceSets.main.allSource`

#### ``Map`<`String`, `File`>` `variables`

The variables to be used for replacing absolute path in dependent-module elements.

Default with `eclipse` and `war` plugins:
  `[:]`

### Script blocks

No script blocks

### Methods

Method | Description
`beforeConfigured(closure)` | Adds a closure to be called before the domain object is configured by this task. The domain object is passed as a parameter to the closure.
`beforeConfigured(action)` | Adds an action to be called before the domain object is configured by this task. The domain object is passed as a parameter to the action.
`property(args)` | Adds a property.
`resource(args)` | Adds a wb-resource.
`variables(variables)` | Adds variables to be used for replacing absolute path in dependent-module elements.
`whenConfigured(closure)` | Adds a closure to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the closure.
`whenConfigured(action)` | Adds an action to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the action.
`withXml(closure)` | Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of a `XmlProvider`. The closure can modify the XML before it is written to the output file.
`withXml(action)` | Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of a `XmlProvider`. The action can modify the XML before it is written to the output file.

### Method details

#### `void` `beforeConfigured`(`Closure` closure)

Adds a closure to be called before the domain object is configured by this task. The domain object is passed as a parameter to the closure.

The closure is executed after the domain object has been loaded from the input file. Using this method allows you to change the domain object in some way before the task configures it.

#### `void` `beforeConfigured`(``Action`<? super `T`>` action)

Adds an action to be called before the domain object is configured by this task. The domain object is passed as a parameter to the action.

The action is executed after the domain object has been loaded from the input file. Using this method allows you to change the domain object in some way before the task configures it.

#### `void` `property`(``Map`<`String`, `String`>` args)

Adds a property.

#### `void` `resource`(``Map`<`String`, `String`>` args)

Adds a wb-resource.

#### `void` `variables`(``Map`<`String`, `File`>` variables)

Adds variables to be used for replacing absolute path in dependent-module elements.

#### `void` `whenConfigured`(`Closure` closure)

Adds a closure to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the closure.

The closure is executed just before the domain object is written to the output file. Using this method allows you to override the configuration applied by this task.

#### `void` `whenConfigured`(``Action`<? super `T`>` action)

Adds an action to be called after the domain object has been configured by this task. The domain object is passed as a parameter to the action.

The action is executed just before the domain object is written to the output file. Using this method allows you to override the configuration applied by this task.

#### `void` `withXml`(`Closure` closure)

Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of a `XmlProvider`. The closure can modify the XML before it is written to the output file.

#### `void` `withXml`(``Action`<? super `XmlProvider`>` action)

Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of a `XmlProvider`. The action can modify the XML before it is written to the output file.