Parent POM And Main Project POM Publish Using Maven To Exchange

Author: Payal Jain

In real-time projects, we re-use the dependencies across projects and APIs, and a parent POM becomes very useful in such requirements.

It is useful to manage shared resources and have a single point of modification to update our projects. The parent POM file is a maven project that can be referenced by a MuleSoft API pom.xml file to get additional information like properties.

Example: If we have the HTTP Connector version specified in a parent POM, then any project depending on that parent POM, can be rebuilt with Maven after changing the parent POM HTTP connector version, and every project would update their internal HTTP Connector without actually modifying the API at all. 

  • Create a new parent POM mule project with the following details in the POM file:
  • Add required properties version details needed to be referenced from the main project:
  • Add <type>custom<type> under the Properties tag:
  • Add mule maven plugin details:
  • Add our repository details under distribution management with the correct groupId and version as v2:
<name>Anypoint Platform Exchange Repository</name>

Note: Corresponding Exchange’s Username and password must be present in our local .m2 folder for Maven->conf->settings.xml location as:

  • Run the ‘mvn’ clean install deploy’ command from the parent POM’s folder in our local.
  • It will deploy your Parent POM in exchange, but it can’t be viewed directly in Exchange. To verify the deployment run the maven command in our main project (after making necessary changes in the main project’s POM file to refer to the parent POM). We could see the client-parent-pom folder created under .m2/ after this run, which implies Parent POM is deployed correctly.
  • Changes to be made in the main project’s POM.

Add below detail:

  • Replace the actual version with a placeholder:


  • The main differences are that we have the “parent” element and that we are using a Maven property to specify the HTTP Connector version. Also, we can see that the Maven property to set the HTTP connector is not present in this pom.xml but instead in the parent POM.
  • This is very useful if we have multiple projects and we have to update the versions to the latest one with one change in parent POM without impacting other main projects’ POM files.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.