Giter Club home page Giter Club logo

jboss-deployment-structure's Introduction

Gradle Plugin: jboss-deployment-structure Build Status

This gradle plugin helps to generate a jboss-deployment-structure.xml based on the deploy configuration of the ear plugin.

Usage

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.

Contributors

  • Mario Mohr

  • Carsten Schmidt

jboss-deployment-structure's People

Contributors

jazzschmidt avatar malys avatar mamohr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jboss-deployment-structure's Issues

Handling of earSubdeploymentsIsolated might be backwards.

According to the Wildfly Docs: "By default [] is set to false...."

When using this module as follows (setting it to the default value)

jbossDeploymentStructure {
    earSubdeploymentsIsolated = false
}

will generate:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
  <ear-subdeployments-isolated>
    false
  </ear-subdeployments-isolated>
</jboss-deployment-structure>

But when using this module as follows (setting it to the non-default value)

jbossDeploymentStructure {
    earSubdeploymentsIsolated = true
}

will generate:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
</jboss-deployment-structure>

I think the logic to determine if the element should be included or not, is just backwards...or assumes the default value is true.

In addition to fixing the logic, I think a better approach might be to do this: If earSubdeploymentsIsolated is included in the Gradle DSL, then include the value in the jboss-deployment-structure.xml to whichever entry the user set it to.

Adding system paths

Hi!

We need to add a system dependency element in our subdeployment.
Is this possible?

<sub-deployment name="my-war.war">
   <dependencies>
      <system>
         <paths>
               <path name="com/sun/net/httpserver"/>
         </paths>
      </system>
   </dependencies>
  ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.