The Maven ESB plugin supports packaging of ESB related projects into reusable artifacts. These artifacts are ZIP files which can be referenced by other ESB projects (e.g. ESB service type can be referenced by an instance project) via Maven dependencies. These ZIP artifacts contain additional information about the artifact which used to package the artifact at the SDM level. This information is stored in the form of ".snippet" files.
An important detail is the implementation of the dependency handling in the plugin. During packaging the plugin checks all dependencies and makes sure that it doesn't export/package anything that is already packaged in a transitive artifact (e.g. service instance projects with a dependency to a service type do not package/export the service type). This mechanism allows to keep the artifact size at a minimum and avoids duplicate resources. Of course the developer is responsible to define the correct dependencies.
Typically, the following projects types will be used:
It's important to put project resources into the proper project to allow standalone reuse. A Maven Site should be part of every project and contain the project related documentation.
The ESB specific directories just extend the Maven Standard Directory Layout.
A developer doesn't have to care about tailoring (except selecting service init paramteres for tailoring) until the creating the SDM projet which depends on the other ESB artifacts. During SDM packaging the plugin will generate a target/sdm/generated.tailoring.properties file, which contains the variables and extracted values of all projects variable snippets. This file can be used as a template for environment specific tailoring.properties files (e.g.: int.tailoring.properties).
Tailoring maps are generated from the snippets and added to the generated SDM model target/sdm/xars/tailor. For each artifact a Stringreplacemap is generated automatically. This map replaces sonicfs:///workspace/eclipse-project-name/src/main with sonicfs:///ESBArtifacts/group/ID/artifactID/version. e.g.: stringReplaceMap updatedName="sonicfs:///ESBArtifacts/com/lhsystems/iocc/esb/instances/instances-mds/1.0-SNAPSHOT" name="sonicfs:///workspace/instances-mds/src/main"/ This leads to one root directory ESBArtifacts in the SonicFS which contains all resources used by the ESB services/processes. Everything below src/main will be added to the XAR and will appear in the SonicFS.
JAR dependencies (e.g needed by service types) will be placed at a central location in the SonicFS too (sonicfs://ESBResources...).
Some scenarios require to replace a configuration file (e.g. Spring configuration). This can be done by changing the path t the resource in the tailoring.properteis fie and add the environment specific configuration file as a resource to the SDM project.
e.g.:
Relevant section from a tailoring.properties file:
... @svc.MyWSMQSample.Connection_Factory_Properties@=sonicfs:///ESBArtifacts/com/company/esb/sdm/sdm-sample/1.0-SNAPSHOT/resources/build.ta-config/wsmq/WMQConnectionFactory.properties ...
ESB service types extend the Maven structure as follows:
Directory | Description |
src/main/java | Application/Library sources |
src/main/resources | Application/Library resources |
src/main/sonicesb/services | Location for the esbstyp, properties & gif files for the service type |
src/main/filters | Resource filter files |
src/main/assembly | Assembly descriptors |
src/main/config | Configuration files |
src/main/webapp | Web application sources |
src/test/java | Test sources |
src/test/resources | Test resources |
src/test/filters | Test resource filter files |
src/site | Site |
LICENSE.txt | Project's license |
README.txt | Project's readme |
Process ESB projects are used to host an ESB process and the runtime resources of the service types. They extend the Maven structure as follows:
Directory | Description |
deploy/generated-src | ESB and SonicFS artifacts which where exported from the local Domain by the plugin during packaging |
src/main/sonicesb | Sonic ESB resources (e.g. XCBR) used by service instances runtime parameters |
src/main/sonicesb/cbr | Content-based routing files (*.cbr,*.xcbr) |
src/main/sonicesb/esbdb | Database service configuration (*.esbdb) |
src/main/sonicesb/esbws | Web service invocation (*.esbws) |
src/main/sonicesb/processes | ESB processes (*.esbp) |
src/main/sonicesb/scripts | JavaScript files (*.js) |
src/main/sonicesb/wsdl | WSDL files (*.wsdl) |
src/main/sonicesb/xslt | XSLT files (*.xsl) |
src/main/resources | Any other resources needed by your services for runtime |
src/main/resources/ESB | location of the ExportProperties.xml file (optional) |
An SDM Project contains the SDM model and the tailoring properties files in its standard layout, but under src/main/SDM. Note that this project type does not contain a deploy directory.
Directory | Description |
src/main/sonicesb | Contains the SDM Model.xml, Tuning.xml, tailoring properties files |
src/main/sonicesb/resources | Files which should be available in the directory of the resulting SDM model (e.g. files needed for custom ANT tasks) as they are needed during SDM model execution. |
src/main/resources | Any resources that you want to have in the SonicFS. These will be installed with the SDM model (e.g. environment specific WSMQ .properties). It is handled exactly the same way as any other ESB project (see Automatic Tailoring above) |