Parent POM for Mulesoft applications
This project follows the standards defined in the Development Process Document in Anypoint Exchange. The details to compile and package the asset are in the Build Environment section.
- Description
- Using the parent POM
- List of plugins and dependencies
- Installation in your organization
- Recommended content
In Maven, a parent POM is a concept that allows you to define a common configuration and set of dependencies for multiple related projects within an organization or a software development team. It promotes code reuse and consistency across projects.
The parent POM acts as a blueprint or a template for child projects. It defines common configuration elements such as project version, organization details, build settings, and repositories. It also includes dependency management sections where you can define the shared dependencies required by all child projects. This allows you to centrally manage the versions and configurations of shared libraries and frameworks.
When you create a new Maven project, you can specify a parent POM from which the new project inherits its configuration. The child project can then override or extend the configuration inherited from the parent POM as needed. By inheriting from a parent POM, the child projects automatically adopt the common settings defined in the parent, reducing duplication and making it easier to maintain consistency across the project ecosystem.
In addition to configuration inheritance, the parent POM can also define common build plugins, profiles, and other build-related configurations that are shared among multiple projects.
To summarize, a Maven parent POM provides a way to define and share common configuration, dependencies, and build settings across multiple projects, enabling consistency, code reuse, and centralized management of project-related settings.
To use the parent POM in any of the child projects, specify the parent
section in the child pom.xml
as follows:
<parent>
<groupId>078efef1-d139-48ed-92f5-f8d4a0592374</groupId>
<artifactId>ilsos-pom</artifactId>
<version>1.0.1</version>
<relativePath/>
</parent>
Update the element version
to match the latest release available.
Next are the plugins and dependencies included in the parent POM and the link to check new versions.
Plugins
Artifact | Documentation / Versions available |
---|---|
mule-maven-plugin | https://mvnrepository.com/artifact/org.mule.tools.maven/mule-maven-plugin?repo=mulesoft-public |
https://docs.mulesoft.com/release-notes/mule-maven-plugin/mule-maven-plugin-release-notes | |
https://help.mulesoft.com/s/article/Issues-with-Maven-3-9-0-when-deploying | |
maven-enforcer-plugin | https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-enforcer-plugin |
maven-resources-plugin | https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin |
maven-clean-plugin | https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin |
exchange-mule-maven-plugin | https://mvnrepository.com/artifact/org.mule.tools.maven/exchange-mule-maven-plugin?repo=mulesoft-releases |
Connectors
Connectors for Mulesoft Metrics Toolkit Application
Databases
Artifact | Documentation / Versions available |
---|---|
derby | https://mvnrepository.com/artifact/org.apache.derby/derby/10.14.2.0 |
It is dependent on Mule JDK compatibility. This is the last version compatible with jdk8 | |
commons-dbcp2 | https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 |
mssql-jdbc | https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc |
mssql-jdbc_auth | https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc_auth |
mule-db-connector | https://mvnrepository.com/artifact/org.mule.connectors/mule-db-connector?repo=mulesoft-releases |
mule4-snowflake-connector | https://anypoint.mulesoft.com/exchange/com.mulesoft.connectors/mule4-snowflake-connector |
snowflake-jdbc | https://mvnrepository.com/artifact/net.snowflake/snowflake-jdbc |
https://docs.snowflake.com/en/developer-guide/jdbc/jdbc |
Log Management
Artifact | Documentation / Versions available |
---|---|
log4j-core | https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core |
log4j-api | https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api |
logzio-log4j2-appender | https://mvnrepository.com/artifact/io.logz.log4j2/logzio-log4j2-appender |
logzio-sender | https://mvnrepository.com/artifact/io.logz.sender/logzio-sender |
Optional artifacts
Artifact | Documentation / Versions available |
---|---|
mule-ftp-connector | https://mvnrepository.com/artifact/org.mule.connectors/mule-ftp-connector |
mule-sftp-connector | https://mvnrepository.com/artifact/org.mule.connectors/mule-sftp-connector |
mule-salesforce-connector | https://anypoint.mulesoft.com/exchange/com.mulesoft.connectors/mule-salesforce-connector |
gov version - https://maven.gov.anypoint.mulesoft.com/api/v2/maven/com/mulesoft/connectors/mule-salesforce-connector/maven-metadata.xml |
|
https://docs.mulesoft.com/salesforce-connector/10.18 | |
mule-email-connector | https://mvnrepository.com/artifact/org.mule.connectors/mule-email-connector?repo=mulesoft-releases |
Spring Framework artifacts
All next dependencies have a dependency on the Mulesoft Runtime version, so they shoud not be updated to the latest available version.
Mule Spring connector: link Spring Module Release Notes: [link])(https://docs.mulesoft.com/release-notes/connector/spring-module-release-notes)
Artifact | Documentation / Versions available |
---|---|
spring-beans | https://mvnrepository.com/artifact/org.springframework/spring-beans |
spring-core | https://mvnrepository.com/artifact/org.springframework/spring-core |
spring-context | https://mvnrepository.com/artifact/org.springframework/spring-context |
spring-security-config | https://mvnrepository.com/artifact/org.springframework.security/spring-security-config |
spring-security-core | https://mvnrepository.com/artifact/org.springframework.security/spring-security-core |
spring-security-crypto | https://mvnrepository.com/artifact/org.springframework.security/spring-security-crypto |
spring-jdbc | https://mvnrepository.com/artifact/org.springframework/spring-jdbc |
Follow the next steps to install this asset in your organization.
Update the groupId with your organization ID
Example:
<groupId>078eefffa-d139-48ed-92f5-f8d4a0592374</groupId>
<artifactId>common-parent-pom</artifactId>
<version>1.0.1</version>
<packaging>pom</packaging>
Update the distributionManagement section
- Update the Mulesoft cloud
- Set the name of the repository ID, the default name is anypoint-exchange-v3
<distributionManagement>
<repository>
<!-- Commercial version: Cloudhub -->
<id>anypoint-exchange-v3</id>
<name>Assets for your anypoint organization</name>
<url>https://maven.anypoint.mulesoft.com/api/v3/organizations/${project.groupId}/maven</url>
<!-- MuleSoft EU Cloud
<url>https://maven.eu1.anypoint.mulesoft.com/api/v3/organizations/${project.groupId}/maven</url>
-->
<!-- MuleSoft Government Cloud
<url>https://maven.gov.anypoint.mulesoft.com/api/v2/organizations/${project.groupId}/maven</url>
-->
<layout>default</layout>
</repository>
</distributionManagement>
- The repository id from the pom.xml distributionManagement must be declared in this file
Example:
<profiles>
<profile>
<id>mulesoft</id>
<repositories>
<repository>
<id>anypoint-exchange-v3</id>
<name>Assets for your anypoint organization</name>
<url>https://maven.anypoint.mulesoft.com/api/v3/maven/</url>
</repository>
...
...
<repositories>
<profile>
<profiles>
Provide the credentials to authenticate to the Anypoint Platform, the following example uses a connected app.
<servers>
<server>
<id>anypoint-exchange-v3</id>
<username>~~~Client~~~</username>
<password>6bbbbbbbf5624373b94775e9b17XXXXX~?~8302aaaaa92B436EB64829567eBXXXX</password> </server>
<server>
<id>mulesoft-enterprise-repository</id>
<username>MYUSER</username>
<password>MYPASSWORD</password>
</server>
</servers>
A complete example of the settings file is provided in the repository, and the file name is settings-example.xml
Connected App
The connected app must have the role Exchange Contributor or the role Exchange Administrator.