Skip to content

Commit

Permalink
BZ-1025416: Unify BPMS and BRMS modules distributions in a single build.
Browse files Browse the repository at this point in the history
  • Loading branch information
romartin committed Nov 3, 2013
1 parent 1b0331f commit b1ba180
Show file tree
Hide file tree
Showing 213 changed files with 1,329 additions and 680 deletions.
190 changes: 82 additions & 108 deletions kie-eap-integration/README.md
@@ -1,123 +1,97 @@
Custom distribution for JBoss EAP based on static modules
==========================================================

BPMS/BRMS application are distributed using skinny WARs for JBoss EAP 6.1, JBoss AS7, etc. But these distributions depend only on JBoss EAP base static modules.

This module allows to create a BPMS/BRMS distribution based on base EAP modules and custom new generated ones. So, this distribution contains:

1.- A new BPMS static modules layer for JBoss EAP (named <code>bpms</code>) - This layer is used when deploying the BPMS skinny war (artifact #3)

2.- A new BRMS static modules layer for JBoss EAP (named <code>brms</code>) - This layer is used when deploying the BRMS skinny war (artifact #4)

3.- Skinny WAR for BPMS

4.- Skinny WAR for BRMS

5.- Skinny WAR for jBPM dashboard


BPMS Layer distribution
-----------------------

The static modules layer distribution adds the follosing modules:

* org.kie.lib
* org.kie
* org.uberfire
* org.sonatype.aether
* org.apache.ant
* org.apache.camel
* org.codehouse.plexus
* org.apache.commons.math
* org.apache.commons.compress
* org.drools
* org.apache.commons.exec
* org.apache.helix
* org.jbpm
* org.eclipse.jgit
* org.apache.lucene
* org.apache.maven
* org.mvel
* org.apache.commons.net
* org.apache.poi
* com.google.protobuf
* org.sonatype.sisu
* org.jboss.solder
* org.sonatype.maven
* org.sonatype.plexus
* org.apache.commons.vfs (Not in BRMS ditribution)
* org.apache.maven.wagon
* org.apache.zookeeper
* org.apache.batik
* org.apache.commons.httpclient
* org.apache.commons.fileupload
* org.apache.commons.jxpath
* org.apache.commons.logging
* com.opensymphony.quartz (Not in BRMS ditribution)
* org.junit
* org.apache.xmlbeans

NOTE: For BPMS and BRMS, the modules list is the same, but the resources that each module contains is not the same.

How to run
==========

Enable this module
JBoss EAP/AS distributions builder
==================================

This module allows to create custom distributions for JBoss EAP/AS based on static modules.

For more information about JBoss EAP/AS modules refer to [JBoss community documentation](https://docs.jboss.org/author/display/MODULES/Home)


Table of contents
------------------
* This <code>kie-eap-integration</code> maven module is NOT executed on maven build process by default.

* To activate this module, there are two options:
* run with profile <code>eap-modules</code> from kie-wb-distributions root.
$# mvn clean install -Deap-modules
* run $# mvn clean install from this kie-eap-integration root directory.
* **[Builder strategy](#builder-strategy)**

* **[Builder stucture](#builder-structure)**

* **[Core module](#core-module)**

* **[Distributions module](#distributions-module)**

* **[Usage](#usage)**

Builder strategy
================

The builder module implementation is based on ANT and Maven:

* ANT: Read module descriptors and generate module resources and assembly descriptor files.
* Maven: Geneate the final distributions by assembling the generated assembly descriptor files.

The main goals to generate a product distribution are:

1.- Obtain de list of static modules to create from a descriptor file named <code>modules.list</code>.

2.- Obtain the list of dynamic modules to create (web applications)

3.- For each static module, read it's definition, resources and dependencies to other modules from the module descriptor files.

EAP version to deploy
---------------------
* NOTE: By default, the distribution is generated for JBoss EAP 6.1.1. If you must generate for EAP 6.1.0 use <code>-Deap-610</code>
$# mvn clean install -Deap-modules Deap-610
4.- For each static module, generate module descriptor (module.xml), copy module resources (jars, etc) into a temporal directory.

Profiles:
----------
- If no profile for building this module is specified, NO distributions are generated.
5.- Generate the assembly descriptor for static modules.

- To generate the BPMS static layer distribution, use <code>mvn clean install -Dbpms-static-layer</code> to enable the bpms-static-layer profile and generate the static layers for BPMS.
- To generate the BRMS static layer distribution, use <code>mvn clean install -Dbrms-static-layer</code> to enable the brms-static-layer profile and generate the static layers for BRMS.
- To generate the BPMS (kie-wb) distribution, use <code>mvn clean install -Dbpms</code> to enable the bpms profile and generate the skinny war.
- To generate the BRMS (kie-drools-wb) distribution, use <code>mvn clean install -Dbrms</code> to enable the brms profile and generate the skinny war.
- To generate the JBPM Dashboard distribution, use <code>mvn clean install -Djbpm-dashboard</code> to enable the jbpm-dashboard profile and generate the skinny war.
5.- For each dynamic module, read it's definition and dependencies descriptor files.

**IMPORTANT NOTE**:
* Each profile has different dependencies. If using more than one profile at same build, the dependencies from used profiles are merged.
* **So, DO NOT USE BPMS / BRMS PROFILES IN SAME BUILD.**
* For example:
* Generate BPMS artifacts
** run <code>mvn clean install -Dbpms-static-layer -Dbpms -Djbpm-dashboard</code>
** Artifacts generated: modules ZIP for BPMS, skinny kie-wb WAR, skinny jBPM-dashboard WAR
* Generate BRMS artifacts
** run <code>mvn clean install -Dbrms-static-layer -Dbrms</code>
** Artifacts generated: modules ZIP for BRMS, skinny kie-drools-wb WAR
* But do **NOT** run <code>mvn clean install -Dbpms-static-layer -Dbpms -Dbrms-static-layer -Dbrms</code>
6.- For each dynamic module, generate the jboss-deployment-structure.xml file and the assembly descriptor (excluding artifacts already contained in static modules).

7.- Assembly the static modules distribution (using the dynamic assembly generated files).

8.- Assembly each dynamic module distribution (using the dynamic assembly generated files).

Resulting artifacts
---------------------
* The resulting artifacts are generated into <code>target</code> directory:
- <code>kie-eap-integration-X.Y.Z-SNAPSHOT-eap-bpms-static-modules.zip</code> Contains the BPMS static modules zip distribution to deploy on JBoss EAP.
- <code>kie-eap-integration-X.Y.Z-SNAPSHOT-eap-brms-static-modules.zip</code> Contains the BRMS static modules zip distribution to deploy on JBoss EAP.
- <code>kie-eap-integration-X.Y.Z-SNAPSHOT-org.kie.kie-wb-webapp-eap-modules.war</code> Contains the skinny war distribution for kie-wb (BPMS) artifact customized on new static bpms modules
- <code>kie-eap-integration-X.Y.Z-SNAPSHOT-org.kie.kie-drools-wb-webapp-eap-modules.war</code> Contains the skinny war distribution for kie-drools-wb (BRMS) artifact customized on new static bpms modules
- <code>kie-eap-integration-X.Y.Z-SNAPSHOT-org.jbpm.dashboard.jbpm-dashboard-eap-modules.war</code> Contains the skinny war distribution for jBPM Dashbuilder artifact customized on new static bpms modules

Deployment on JBoss EAP
=======================
Builder stucture
================

To deploy the resulting artifacts to a JBoss EAP installation, please follow the steps:
This project contains two sub-modules:

1.- Unzip <code>kie-eap-integration-X.Y.Z-SNAPSHOT-eap-bpms-static-modules.zip</code> or <code>kie-eap-integration-X.Y.Z-SNAPSHOT-eap-brms-static-modules.zip</code> into $JBOSS_HOME.
* **[Core module](#core-module)**

This module contain builder core files for generating the static and dynamic modules.

* **[Distributions module](#distributions-module)**

This module is the parent module for all product distributions.

Core module
===========

This module contain builder core files for generating the static and dynamic modules.

Directory structure:

* <code>eap-configurations</code>: Provides some information for each EAP/AS versions.
* <code>modules</code>: Contains common static modules definitions.
* <code>patches</code>: Contains some common patches to apply. See [patches documentation](https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-eap-integration/kie-eap-integration-core/src/main/resources/eap-modules/patches/README.md).
* <code>scripts</code>: Contains builder ANT scripts.
* <code>templates</code>: Contains builder templates.

Distributions module
====================

This module is the parent module for all product distributions.

This module uses the core one to generate static and dynamic modules for a given product.

To obtain information about current EAP product distributions, please refer to [kie-eap-integration-distributions/README.md](https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-eap-integration/kie-eap-integration-distributions/README.md) file.


Usage
=====
* This <code>kie-eap-integration</code> maven module is NOT executed on maven build process by default.

* To activate this module, there are two options:

2.- Copy a generated skinny war (for example <code>kie-eap-integration-X.Y.Z-SNAPSHOT-org.kie.kie-wb-webapp-eap-modules.war</code>) into $JBOSS_HOME/standalone/deployments
1.- run with profile <code>eap-modules</code> from <code>kie-wb-distributions</code> root: Ex: <code>$# mvn clean install -Deap-modules</code>

3.- Run JBoss EAP
2.- run <code>$# mvn clean install</code> from <code>kie-eap-integration</code> root directory.

**IMPORTANT NOTE**: Please, use a clean JBoss EAP installation for deployment.
* To obtain more information about distributions generation refer to [kie-eap-integration-distributions/README.md](https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-eap-integration/kie-eap-integration-distributions/README.md) file.
15 changes: 15 additions & 0 deletions kie-eap-integration/kie-eap-integration-core/.gitignore
@@ -0,0 +1,15 @@
/target
/local
/overlays

# Eclipse, Netbeans and IntelliJ files
/.*
/**/.*
!.gitignore
/nbproject
*.ipr
*.iws
*.iml

# Repository wide ignore mac DS_Store files
.DS_Store
18 changes: 18 additions & 0 deletions kie-eap-integration/kie-eap-integration-core/pom.xml
@@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie</groupId>
<artifactId>kie-eap-integration</artifactId>
<version>6.1.0-SNAPSHOT</version>
</parent>

<groupId>org.kie</groupId>
<artifactId>kie-eap-integration-core</artifactId>
<name>KIE JBoss EAP integration - Core</name>

<dependencies></dependencies>

<build></build>

</project>
Expand Up @@ -4,7 +4,7 @@ org.apache.commons.net
org.apache.commons.vfs
org.apache.cxf
org.apache.helix
org.drools
org.uberfire
org.jboss.weld.core
org.mvel
org.sonatype.maven
Expand Up @@ -13,7 +13,7 @@ CDI Extensions
* In EAP 6.1.0.GA the CDI Extensions declared in JARs from the BPMS layer are not loaded.
* This bug is already reported and fixed for EAP 6.1.1.
See https://bugzilla.redhat.com/show_bug.cgi?id=988093
* The patch consist of copying the resources from jars inside <code>META-INF/servicesc/code> directory of the webapp.
* The patch consist of copying the resources from jars inside <code>META-INF/services</code> directory of the webapp.

Servlet spec 3.0 - Webfragments
-------------------------------
Expand Down
Expand Up @@ -7,10 +7,12 @@ Generates the jboss-deployment-structure.xml definition file and the assembly fo
INPUT parameters:
- module-name -> The dynamic module name to create all stuff.
- static-modules-source-path -> The source folder where all module descriptors, module dependencies and modules.list files are located.
- static-modules-list-file -> The path where generating module.list file is located
- eap-configuration-file -> The path for the EAP configuration properties.
- dynamic-modules-source-path -> The source forlder where all module descriptors, module dependencies and modules.list files are located.
- dynamic-modules-source-path -> The source forlder where all dynamic module descriptors and module dependencies files are located.
- dynamic-modules-output-path -> The output path where generating all modules stuff.
- dynamic-module-assembly-id -> The ID for the generated assembly descriptor.
- dynamic-module-assembly-war-source -> The source "skinny" war for assembly descriptor.
- dynamic-module-assembly-output-file -> The path where generating the dynamic module assembly descriptor..
- templates.path -> The source forlder where all templates are located.
Expand All @@ -26,20 +28,21 @@ OUTPUT:
- META-INF (optional - if CDI extensions patch is enabled)
-->

<project name="build-dynamic-module" xmlns:ac="net.sf.antcontrib" default="main" basedir="../">
<project name="build-dynamic-module" xmlns:ac="net.sf.antcontrib" default="main" basedir="../..//">

<!-- Common utilities. -->
<import file="build-utils.xml"/>

<!-- EAP configuration utils. -->
<import file="build-eap-utils.xml"/>

<property name="modules.source.path" value="${dynamic-modules-source-path}${file.separator}"/>
<property name="modules.static.source.path" value="${static-modules-source-path}${file.separator}"/>
<property name="modules.dynamic.source.path" value="${dynamic-modules-source-path}${file.separator}"/>
<property name="modules.list.file.path" value="${static-modules-list-file}"/>
<property name="modules.output.path" value="${dynamic-modules-output-path}${file.separator}"/>
<property name="module.assembly.output.path" value="${dynamic-module-assembly-output-file}"/>
<property name="module.assembly.war.source" value="${dynamic-module-assembly-war-source}"/>

<property name="module.assembly.id" value="${dynamic-module-assembly-id}"/>
<property name="module.jboss-deployment-structure.output.path" value="${modules.output.path}${module-name}${file.separator}jboss-deployment-structure.xml"/>
<property name="module.webfragments.output.path" value="${modules.output.path}${module-name}${file.separator}"/>

Expand Down Expand Up @@ -67,7 +70,7 @@ OUTPUT:
<target name="main" depends="clean">

<!-- Read module definition file. -->
<property name="module.file" value="${modules.source.path}${module-name}.module"/>
<property name="module.file" value="${modules.dynamic.source.path}${module-name}.module"/>
<fail message="Module '${module-name}' definition file not found at path ${module.file}.">
<condition>
<not>
Expand Down Expand Up @@ -221,7 +224,7 @@ OUTPUT:
<param type="token" name="DEPENDENCY_SET_EXCLUDES" value="${module.assembly.dependency-set.exludes.content}"/>
<param type="token" name="DEPENDENCY_SET_INCLUDE" value="${module.assembly.war.source}"/>
<param type="token" name="ASSEMBLY_FORMAT" value="war"/>
<param type="token" name="ASSEMBLY_ID" value="${module.name}-eap-modules"/>
<param type="token" name="ASSEMBLY_ID" value="${module.assembly.id}"/>
</template-file-params>
<template-file-result>
<property name="module.assembly.output.content" value="@{template-content}"/>
Expand Down Expand Up @@ -323,7 +326,7 @@ OUTPUT:


<!-- Generated the module dependencies section. -->
<property name="module.dependencies.file" value="${modules.source.path}${file.separator}${module-name}.dependencies"/>
<property name="module.dependencies.file" value="${modules.dynamic.source.path}${module-name}.dependencies"/>
<fail message="Module '${module-name}' dependencies file not found at path ${module.dependencies.file}.">
<condition>
<not>
Expand Down Expand Up @@ -532,7 +535,7 @@ OUTPUT:
-->
<target name="create-static-module-dependency-set-excludes">
<!-- Read module definition file. -->
<property name="module.list.file" value="${modules.source.path}${module-name}.module"/>
<property name="module.list.file" value="${modules.static.source.path}${module-name}.module"/>

<fail message="Module '${module-name}' definition file not found at path ${module.list.file}.">
<condition>
Expand All @@ -557,7 +560,7 @@ OUTPUT:
<ac:if>
<ac:equals arg1="${static.module.type}" arg2="static"/>
<ac:then>
<loadfile property="module.resources.file.content" srcfile="${modules.source.path}${module-name}.resources" failonerror="true"/>
<loadfile property="module.resources.file.content" srcfile="${modules.static.source.path}${module-name}.resources" failonerror="true"/>
<ac:for param="resource" list="${module.resources.file.content}" delimiter="${line.separator}">
<ac:sequential>

Expand Down
Expand Up @@ -33,7 +33,7 @@ OUTPUT:
- <webfragment jars> (If webfragments patch is enabled)
-->
<project name="build-static-modules" xmlns:ac="net.sf.antcontrib" default="main" basedir="../">
<project name="build-static-modules" xmlns:ac="net.sf.antcontrib" default="main" basedir="../..//">

<!-- Common utilities. -->
<import file="build-utils.xml"/>
Expand Down

0 comments on commit b1ba180

Please sign in to comment.