This section is a guideline for developers. It explains how to work with the ESB Maven plugin.
Note that this is not specific to this plugin. When starting to develop a new ESB project you have to make sure that the project adheres to the standard project structure. You can get this by:
Depending on the type of ESB project you will add files to the project. The addition of the ExportProperties file (src/main/sonicesb/ExportProperties.xml) is optional for some project types. As soon as you have finished development/coding you can package your project.
During packaging (e.g. mvn package) the ESB plugin creates a generated-src directory in the deploy directory (deploy/generated-src). The structure is a the same as an extracted XAR file.
Similar to the ESB export tool the plugin connects to the local Sonic domain (default is Domain1 but this can be configured) and exports all project related ESB and SonicFS artifacts.
Maven dependencies are taken into account for this as well. This means that all resources (ESB and SoncFS) of the ZIP type dependencies are ignored during export. ESB processes are always uploaded before the export is performed and added to the ExportProperties.xml as export root. If no ExportProperties file exists, the generated ExportProperties file will only contain the processes as roots. Therefore you do not have to define an ExportProperties file for ESB process projects as long as all needed resources can be traversed via the process.
It is recommended to put the deploy directory under version control such that builds can succeed if not running domain is available.
If Maven dependencies are added after the first packaging you have to check the generated-src manually and delete the obsolete resources. The ESB plugin will not delete these files for you. Or you can delete and regenerate the generated-src. This is only possible if you have all ESB artifacts in your local Sonic Domain.
The resulting deploy/generated-src directory can be used for developer imports. Every time a developer checks out a project from the version control system, he has to do an ESB import/upload of the deploy/generated-src structure (e.g. use the upload all). Otherwise changes in ESB configurations (e.g. Endpoint) will not be updated in the local Domain. The next packaging run then would overwrite the deploy/generated-src with outdated configurations.
ATTENTION: If you haven't imported a project/process into your local domain and run package it will delete the content of your deploy folder!!
The plugin is bound to the Maven package phase.
As already mentioned above the ExportProperties file is optional for projects that contain only ESB processes, ESB service types adn projects which contain only file resources (e.g. XSL, JS).
Initially the ESB Deployment Export Tool can be used to create an ExportProperties file.
If a Domain Manager is online it will try to do the export. Then it will use the deploy/generated-src to generate a ZIP file representing the project's packaging in the target directory.