This gradle plugin helps to generate a jboss-deployment-structure.xml based on the deploy configuration of the ear plugin.
To use the plugin, configure your build.gradle
script and add the plugin:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.mamohr.gradle:jboss-deployment-structure:0.10.0'
}
}
apply plugin: 'com.github.mamohr.jboss-deployment-structure'
When applied to an ear project, it will create a jbossDeploymentStructure
extension.
jbossDeploymentStructure {
structureVersion ='1.2' //JBoss deployment structure schema version
earSubdeploymentsIsolated = false
globalExclude 'my-excluded-module:1.1' //global excludes will be added to the deployment and ALL subdeployments
exclude 'my-other-excluded-module' // exclude will be added to the deployment
dependency 'my-dependency:1.1' //Adds dependency 'my-dependency' with slot '1.1' to deployment
dependency ('my-other-dependency') { //Adds dependency with additional attributes
slot = '1.1'
export = true
optional = true
annotations = true
services = 'NONE' //possible values [NONE, IMPORT, EXPORT]
metaInf = 'IMPORT' //possible values [NONE, IMPORT, EXPORT]
imports { //Configure imports with exclusions or inclusions of paths
exclude 'lib/ext'
include 'ext'
}
exports { //Configure exports
exclude 'lib/ext'
include 'ext'
}
}
resource 'my-library.jar'
resource(path: 'lib/ext-library.jar', physicalCodeSource: true) { //Configure resource filter
include 'api/query'
exclude 'api/info'
}
subdeployments { // Configure additional subdeployments
'my-war.war' {
dependency 'another.module'
exclude 'excluded.module'
resource 'my-war.war'
}
}
}
For ejb-jar or war projects the plugin creates a jbossSubdeployment
extension. It can contain dependencies and excludes as in the following example:
jbossSubdeployment {
dependency 'my-other-dependency' {
slot = '1.1'
export = true
optional = true
annotations = true
}
exclude 'excluded.module'
}
All dependencies in the deploy configuration of the ear will be automatically added to the jboss-deployment-structure.xml with the configured global excludes.
For more examples have a look at the integration tests.