|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (17)
View Page HistoryPetals ESB is a platform built with Apache Maven.
Among all the tools that come with Petals, there is a Maven plug-in for Petals, called the *[Petals Maven plug-in*. plug-in|petalscomponents:Maven Petals Plug-in].
For the moment, the documentation for this Maven plug-in is only available in [Petals' forge|http://websvn.ow2.org/listing.php?repname=petals&path=%2Ftrunk%2Ftools-commons%2Fmaven-petals-plugin%2Fsrc%2Fdoc%2Fdocbook%2Fdoc-fr%2F], but should be soon posted on Petals wiki.
{column}
Notice that there is no defined parent.
To fill-in these fields automatically, customize the generated POM, please read the [preferences section|#preferences].
h2. Service Assembly projects
Notice that there is no defined parent.
To fill-in these fields automatically, customize the generated POM, read the [preferences section|#preferences].
\\
\\
However, it is possible to update the SA's POM automatically when its jbi.xml is modified.
An option is available in the [preferences|#preferences].
\\
An option is available in the [preferences|#preferences].
\\
However, when you import an existing service assembly, or more generally, when you generate a set of SU and SA projects, the *dependencies* section is filled-in automatically. It is planned to complete the tooling to update automatically the SA dependencies.
1. If the SU and SA projects are generated (e.g. service assembly import), the dependencies are set automatically.
2. If the SU and SA projects are built by hand or edited, then you have to update the SA dependencies in its pom.xml.
2. If the SU and SA projects are built by hand or edited, then you have to update the SA dependencies in its pom.xml.
The second point can be made automatic through the preferences.
{info}
!PetalsStudio_Maven_1.jpg!
h3. The Petals Maven plug-in
\\
The following elements can be changed in these preferences.
* *Version of the Petals Maven plug-in*: by default, it is the last released version.
* *Default group ID*: by default, it is _org.ow2.petals_.
* *A POM parent*: it can be any pom.xml file, whose location is given as an URI. When provided, the parent attributes are written in the generated pom.xml files.
* *Default group ID*: by default, it is _org.ow2.petals_.
* *A POM parent*: it can be any pom.xml file, whose location is given as an URI. When provided, the parent attributes are written in the generated pom.xml files.
* *Plugin Version*: the version of the [Petals Maven plug-in|petalscomponents:Maven Petals Plug-in].
* *Group ID*: the group ID for all the Maven projects, _org.ow2.petals_ by default.
* *POM parent*: the URL of a pom.xml file. When provided, the parent attributes are written in the generated pom.xml files.
* *Group ID*: the group ID for all the Maven projects, _org.ow2.petals_ by default.
* *POM parent*: the URL of a pom.xml file. When provided, the parent attributes are written in the generated pom.xml files.
These preferences apply for both SU and SA projects.
h3. POM customization
It is possible to generate different POM files for both SU and SA projects.
* *Use default POM* is to be used only if the usual POM are good enough.
* *Use customized POM* is an option to provide a directory containing a set of templates for POM files.
It is possible to generate different POM files for both SU and SA projects.
* *Use default POM* is to be used only if the usual POM are good enough.
* *Use customized POM* is an option to provide a directory containing a set of templates for POM files.
\\
There are 3 kinds of possible templates:
* *sa-default-pom.xml* is the default POM for all the SA projects. This file is required and equivalent to the default POM.
* *su-default-pom.xml* is the default POM for all the SU projects that do not have a component template. This file is required and equivalent to the default POM.
* <component_name>*_su_pom.xml* is a POM template for a SU project associated with this component.
* *sa-default-pom.xml* is the default POM for all the SA projects. This file is required and equivalent to the default POM.
* *su-default-pom.xml* is the default POM for all the SU projects that do not have a component template. This file is required and equivalent to the default POM.
* <component_name>*_su_pom.xml* is a POM template for a SU project associated with this component.
{note}
Notice that the version 1.0 of the studio does not generate complete pom.xml. There is always something to update by hand.
But the general principal (preferences, Maven structure and POM generation) is the same.
But the general principal (preferences, Maven structure and POM generation) is the same.
As an example, "petals-bc-soap_su_pom.xml" will be used for all the SU projects that target the Petals SOAP component.
The default templates can be generated in the given directory by clicking *Generate the default POM templates*.
The default templates can be generated in the given directory by clicking *Generate the default POM templates*.
{note}
\\
The following variables are available for the templates:
|| Variable || Description ||
| *$\{PETALS_ParentArtifactId\}* | The artifact ID of the parent. |
| *$\{PETALS_ParentGroupId\}* | The group ID of the parent. |
| *$\{PETALS_ParentVersion\}* | The version of the parent. |
| *$\{PETALS_Name\}* | The value of the name element in the POM. |
| *$\{PETALS_ArtifactId\}* | The artifact ID. |
| *$\{PETALS_GroupId\}* | The group ID. |
| *$\{PETALS_Version\}* | The version. |
| *$\{PETALS_Description\}* | The value of the description element in the POM. |
| *$\{PETALS_ComponentName\}* | The name of the target component. |
| *$\{PETALS_ComponentVersion\}* | The version of the target component. |
| *$\{PETALS_PetalsMavenPluginVersion\}* | The version of the Petals Maven plug-in. |
| *$\{PETALS_SuDependencies\}* | A list of Maven dependencies toward projects (only makes sense for SA projects). |
| *<!-- $\{PETALS_TestParent\} -->* | A conditional marker, used to test whether a parent was given or not. Text surrounded with this marker will only appear if a parent was specified in the preferences. |
\\
As an example, here is the default template for SU projects.
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ${PETALS_TestParent} -->
<parent>
<artifactId>${PETALS_ParentArtifactId}</artifactId>
<groupId>${PETALS_ParentGroupId}</groupId>
<version>${PETALS_ParentVersion}</version>
</parent>
<!-- ${PETALS_TestParent} -->
<name>${PETALS_Name}</name>
<artifactId>${PETALS_ArtifactId}</artifactId>
<groupId>${PETALS_GroupId}</groupId>
<version>${PETALS_Version}</version>
<packaging>jbi-service-assembly</packaging>
<description>${PETALS_Description}</description>
<dependencies>
${PETALS_SuDependencies}
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.ow2.petals</groupId>
<artifactId>maven-petals-plugin</artifactId>
<version>${PETALS_PetalsMavenPluginVersion}</version>
<extensions>true</extensions>
<configuration>
<updateJBIXml>true</updateJBIXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
{code}
h3. POM Dependencies
This last section only concerns the SA projects.
If the option "Update POM dependencies automatically" is checked, then each time the jbi.xml of a SA project changes (addition, removal, update of a SU project), its POM will be updated automatically. The POM of the referenced SU projects will be read and reported into the POM of the SA project.
{info}
Be careful, automatic updates remove all the dependencies before writing the updated ones.
{info}
The following variables are available for the templates:
|| Variable || Description ||
| *$\{PETALS_ParentArtifactId\}* | The artifact ID of the parent. |
| *$\{PETALS_ParentGroupId\}* | The group ID of the parent. |
| *$\{PETALS_ParentVersion\}* | The version of the parent. |
| *$\{PETALS_Name\}* | The value of the name element in the POM. |
| *$\{PETALS_ArtifactId\}* | The artifact ID. |
| *$\{PETALS_GroupId\}* | The group ID. |
| *$\{PETALS_Version\}* | The version. |
| *$\{PETALS_Description\}* | The value of the description element in the POM. |
| *$\{PETALS_ComponentName\}* | The name of the target component. |
| *$\{PETALS_ComponentVersion\}* | The version of the target component. |
| *$\{PETALS_PetalsMavenPluginVersion\}* | The version of the Petals Maven plug-in. |
| *$\{PETALS_SuDependencies\}* | A list of Maven dependencies toward projects (only makes sense for SA projects). |
| *<!-- $\{PETALS_TestParent\} -->* | A conditional marker, used to test whether a parent was given or not. Text surrounded with this marker will only appear if a parent was specified in the preferences. |
\\
As an example, here is the default template for SU projects.
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ${PETALS_TestParent} -->
<parent>
<artifactId>${PETALS_ParentArtifactId}</artifactId>
<groupId>${PETALS_ParentGroupId}</groupId>
<version>${PETALS_ParentVersion}</version>
</parent>
<!-- ${PETALS_TestParent} -->
<name>${PETALS_Name}</name>
<artifactId>${PETALS_ArtifactId}</artifactId>
<groupId>${PETALS_GroupId}</groupId>
<version>${PETALS_Version}</version>
<packaging>jbi-service-assembly</packaging>
<description>${PETALS_Description}</description>
<dependencies>
${PETALS_SuDependencies}
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.ow2.petals</groupId>
<artifactId>maven-petals-plugin</artifactId>
<version>${PETALS_PetalsMavenPluginVersion}</version>
<extensions>true</extensions>
<configuration>
<updateJBIXml>true</updateJBIXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
{code}
h3. POM Dependencies
This last section only concerns the SA projects.
If the option "Update POM dependencies automatically" is checked, then each time the jbi.xml of a SA project changes (addition, removal, update of a SU project), its POM will be updated automatically. The POM of the referenced SU projects will be read and reported into the POM of the SA project.
{info}
Be careful, automatic updates remove all the dependencies before writing the updated ones.
{info}