Show Table of Contents
1.4. Migrating Maven Projects
Overview
JBoss A-MQ 6.1 now has a JBoss A-MQ BOM (Bill of Materials), which defines the versions of all the JBoss A-MQ Maven artifacts. You can use the BOM to simplify migration of your Maven POM files. Instead of updating the
version elements on each Maven dependency, all you need to do is to import the latest JBoss A-MQ BOM, which defines default versions for all of the dependencies provided by JBoss A-MQ.
JBoss A-MQ BOM
The JBoss A-MQ BOM is a parent POM that defines the versions for all of the Maven artifacts provided by JBoss A-MQ. The JBoss A-MQ BOM exploits Maven's dependency management mechanism to specify default versions for the Maven artifacts, so that it is no longer necessary to specify the artifact versions explicitly in your POM.
Current version of the JBoss A-MQ BOM
The easiest way to discover the current version of the JBoss A-MQ BOM is to examine one of the sample
pom.xml files from the quickstarts examples. For example, in the InstallDir/quickstarts/eip/pom.xml file, you can find a line that defines the JBoss A-MQ BOM version, as follows:
<project ...>
...
<properties>
...
<!-- the version of the JBoss A-MQ BOM, defining all the dependency versions -->
<jboss.fuse.bom.version>6.1.0.redhat-379</jboss.fuse.bom.version>
</properties>
...
</project>How to migrate Maven dependencies using the JBoss A-MQ BOM
To migrate Maven dependencies using the JBoss A-MQ BOM, open the Maven
pom.xml file for your project and edit it as follows:
- Define the JBoss A-MQ BOM version as a property in your
pom.xmlfile, using the current BOM version. For example:<project ...> ... <properties> ... <jboss.fuse.bom.version>6.1.0.redhat-379</jboss.fuse.bom.version> </properties> ... </project> - Reference the JBoss A-MQ BOM parent POM in a
dependencyManagementelement, so that it defines default versions for the artifacts provided by JBoss A-MQ. Add the followingdependencyManagementelement to yourpom.xmlfile:<project ...> ... <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.fuse.bom</groupId> <artifactId>jboss-fuse-parent</artifactId> <version>${jboss.fuse.bom.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ... </project> - Now delete all of the
versionelements in your JBoss A-MQ dependencies. All of the versions defined in the JBoss A-MQ BOM will be applied automatically to your dependencies (through the Maven dependency management mechanism). For example, if you already had some Apache Camel dependencies, as follows:<dependencies> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>2.12.0.redhat-610379</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-blueprint</artifactId> <version>2.12.0.redhat-610379</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jetty</artifactId> <version>2.12.0.redhat-610379</version> </dependency> ... </dependencies>You would delete the version elements, so that the dependencies are specified as follows:<dependencies> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-blueprint</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jetty</artifactId> </dependency> ... </dependencies> - In future, when you migrate to a later version of JBoss A-MQ, all that you need to do to upgrade your
pom.xmlfile is to edit thejboss.fuse.bom.versionproperty, so that it references the new version of the JBoss A-MQ BOM.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.