api / org.gradle.plugins.ear.descriptor / DeploymentDescriptor

DeploymentDescriptor

interface DeploymentDescriptor

A deployment descriptor such as application.xml.

Functions

getApplicationName

abstract fun getApplicationName(): String

The application name. Optional. Only valid with version 6.

getDescription

abstract fun getDescription(): String

The application description. Optional.

getDisplayName

abstract fun getDisplayName(): String

The application display name. Optional.

getFileName

abstract fun getFileName(): String

The name of the descriptor file, typically "application.xml"

getInitializeInOrder

abstract fun getInitializeInOrder(): Boolean

Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules. Optional. Only valid with version 6.

getLibraryDirectory

abstract fun getLibraryDirectory(): String

The name of the directory to look for libraries in. Optional. If not specified, org.gradle.plugins.ear.Ear#getLibDirName() is used. Typically, this should be set via org.gradle.plugins.ear.EarPluginConvention#setLibDirName(String) instead of this property when using the ear plugin.

getModuleTypeMappings

abstract fun getModuleTypeMappings(): MutableMap<String, String>

Mapping of module paths to module types. Non-null by default. For example, to specify that a module is a java module, set moduleTypeMappings["myJavaModule.jar"] = "java".

getModules

abstract fun getModules(): MutableSet<EarModule>

List of module descriptors. Must not be empty. Non-null and order-maintaining by default. Must maintain order if initializeInOrder is true.

getSecurityRoles

abstract fun getSecurityRoles(): MutableSet<EarSecurityRole>

List of security roles. Optional. Non-null and order-maintaining by default.

getVersion

abstract fun getVersion(): String

The version of application.xml. Required. Valid versions are "1.3", "1.4", "5" and "6". Defaults to "6".

module

abstract fun module(module: EarModule, type: String): DeploymentDescriptor
abstract fun module(path: String, type: String): DeploymentDescriptor

Add a module to the deployment descriptor.

readFrom

abstract fun readFrom(reader: Reader): DeploymentDescriptor

Reads the deployment descriptor from a reader.

abstract fun readFrom(path: Any): Boolean

Reads the deployment descriptor from a file. The paths are resolved as defined by org.gradle.api.Project#file(Object)

securityRole

abstract fun securityRole(role: EarSecurityRole): DeploymentDescriptor
abstract fun securityRole(role: String): DeploymentDescriptor

Add a security role to the deployment descriptor.

abstract fun securityRole(action: Action<in EarSecurityRole>): DeploymentDescriptor

Add a security role to the deployment descriptor after configuring it with the given action.

setApplicationName

abstract fun setApplicationName(applicationName: String): Unit

setDescription

abstract fun setDescription(description: String): Unit

setDisplayName

abstract fun setDisplayName(displayName: String): Unit

setFileName

abstract fun setFileName(fileName: String): Unit

setInitializeInOrder

abstract fun setInitializeInOrder(initializeInOrder: Boolean): Unit

setLibraryDirectory

abstract fun setLibraryDirectory(libraryDirectory: String): Unit

setModuleTypeMappings

abstract fun setModuleTypeMappings(moduleTypeMappings: MutableMap<String, String>): Unit

setModules

abstract fun setModules(modules: MutableSet<EarModule>): Unit

setSecurityRoles

abstract fun setSecurityRoles(securityRoles: MutableSet<EarSecurityRole>): Unit

setVersion

abstract fun setVersion(version: String): Unit

webModule

abstract fun webModule(path: String, contextRoot: String): DeploymentDescriptor

Add a web module to the deployment descriptor.

withXml

abstract fun withXml(closure: Closure<Any>): DeploymentDescriptor

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 groovy.util.Node. The closure can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.

abstract fun withXml(action: Action<in XmlProvider>): DeploymentDescriptor

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 groovy.util.Node. The action can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.

writeTo

abstract fun writeTo(writer: Writer): DeploymentDescriptor

Writes the deployment descriptor into a writer.

abstract fun writeTo(path: Any): DeploymentDescriptor

Writes the deployment descriptor into a file. The paths are resolved as defined by org.gradle.api.Project#file(Object)