http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/spring-boot-dm/camel-spring-boot-generator-bom/pom.xml
----------------------------------------------------------------------
diff --git a/spring-boot-dm/camel-spring-boot-generator-bom/pom.xml 
b/spring-boot-dm/camel-spring-boot-generator-bom/pom.xml
new file mode 100644
index 0000000..d5c4125
--- /dev/null
+++ b/spring-boot-dm/camel-spring-boot-generator-bom/pom.xml
@@ -0,0 +1,520 @@
+<?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/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>camel-spring-boot-dm</artifactId>
+        <groupId>org.apache.camel</groupId>
+        <version>2.18.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>camel-spring-boot-bom-ng</artifactId>
+    <packaging>pom</packaging>
+
+    <dependencyManagement>
+
+        <dependencies>
+
+            <dependency>
+                <groupId>com.github.ben-manes.caffeine</groupId>
+                <artifactId>caffeine</artifactId>
+                <version>${caffeine-version}</version>
+            </dependency>
+
+            <!-- Missing from spring-boot -->
+            <dependency>
+                <groupId>org.hibernate</groupId>
+                <artifactId>hibernate-entitymanager</artifactId>
+                <version>${hibernate-version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>${junit-version}</version>
+            </dependency>
+
+            <!-- Choose a uniform jackson1 for testing -->
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-core</artifactId>
+                <version>${jackson-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-core-asl</artifactId>
+                <version>${jackson-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-jaxrs</artifactId>
+                <version>${jackson-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-mapper-asl</artifactId>
+                <version>${jackson-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-xc</artifactId>
+                <version>${jackson-version}</version>
+            </dependency>
+
+            <!-- Missing in spring-boot -->
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-ext</artifactId>
+                <version>${slf4j-version}</version>
+            </dependency>
+
+            <!-- Also missing -->
+            <dependency>
+                <groupId>net.java.dev.jna</groupId>
+                <artifactId>jna-platform</artifactId>
+                <version>${jna-version}</version>
+            </dependency>
+
+            <!-- Some are missing -->
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-util-ajax</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-jmx</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-security</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-client</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-rewrite</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-io</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <!-- Jetty - Mismatch resolved in favour of spring-boot -->
+            <dependency>
+                <groupId>org.eclipse.jetty.websocket</groupId>
+                <artifactId>websocket-api</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty.websocket</groupId>
+                <artifactId>websocket-common</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty.websocket</groupId>
+                <artifactId>websocket-server</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty.websocket</groupId>
+                <artifactId>websocket-servlet</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-server</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-servlet</artifactId>
+                <version>${jetty-version}</version>
+            </dependency>
+
+
+            <!-- ActiveMq from camel -->
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-amqp</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-blueprint</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-broker</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-camel</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-client</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-console</artifactId>
+                <version>${activemq-version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>commons-logging</groupId>
+                        <artifactId>commons-logging</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-http</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-jaas</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-jdbc-store</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-jms-pool</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-kahadb-store</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-karaf</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-leveldb-store</artifactId>
+                <version>${activemq-version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>commons-logging</groupId>
+                        <artifactId>commons-logging</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-log4j-appender</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-mqtt</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-openwire-generator</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-openwire-legacy</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-osgi</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-partition</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-pool</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-ra</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-run</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-runtime-config</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-shiro</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-spring</artifactId>
+                <version>${activemq-version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>commons-logging</groupId>
+                        <artifactId>commons-logging</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-stomp</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-web</artifactId>
+                <version>${activemq-version}</version>
+            </dependency>
+
+            <!-- Missing in spring-boot -->
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-scala_2.11</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-jaxrs</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+
+            <!-- Jackson From spring-boot -->
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-annotations</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-core</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-databind</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-cbor</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-csv</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-smile</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-xml</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-yaml</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-guava</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-hibernate4</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-hibernate5</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-jdk8</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-joda</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-json-org</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.datatype</groupId>
+                <artifactId>jackson-datatype-jsr310</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.jaxrs</groupId>
+                <artifactId>jackson-jaxrs-base</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.jaxrs</groupId>
+                <artifactId>jackson-jaxrs-json-provider</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-jaxb-annotations</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-kotlin</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-parameter-names</artifactId>
+                <version>${jackson2-version}</version>
+            </dependency>
+
+            <!-- Spring dependencies (not included in spring-boot BOM) -->
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-web</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-aop</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-beans</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-tx</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-context-support</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-oxm</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-jms</artifactId>
+                <version>${spring-version}</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>camel-parent</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+
+        </dependencies>
+
+    </dependencyManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>bom-generator-maven-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <dependencies>
+                        <includes>
+                            <include>org.apache.camel:*</include>
+                            <include>org.springframework.boot:*</include>
+
+                            <include>com.github.ben-manes.caffeine:*</include>
+                            <include>org.hibernate:*</include>
+                            <include>junit:junit</include>
+                            <include>org.codehaus.jackson:jackson*</include>
+                            <include>org.slf4j:*</include>
+                            <include>net.java.dev.jna:*</include>
+
+                            <include>org.eclipse.jetty:*</include>
+                            <include>org.eclipse.jetty.websocket:*</include>
+
+                            <include>org.apache.activemq:*</include>
+
+                            <include>com.fasterxml.jackson.*:*</include>
+
+                            <include>org.springframework:*</include>
+
+                        </includes>
+                        <excludes>
+                            <exclude>org.springframework:springloaded</exclude>
+                        </excludes>
+                    </dependencies>
+
+                    <sourcePom>${basedir}/target-template-pom.xml</sourcePom>
+                    
<targetPom>${basedir}/../camel-spring-boot-bom-ng/pom.xml</targetPom>
+                </configuration>
+
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/spring-boot-dm/camel-spring-boot-generator-bom/target-template-pom.xml
----------------------------------------------------------------------
diff --git 
a/spring-boot-dm/camel-spring-boot-generator-bom/target-template-pom.xml 
b/spring-boot-dm/camel-spring-boot-generator-bom/target-template-pom.xml
new file mode 100644
index 0000000..f1de6ac
--- /dev/null
+++ b/spring-boot-dm/camel-spring-boot-generator-bom/target-template-pom.xml
@@ -0,0 +1,21 @@
+<?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/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>camel-spring-boot-dm</artifactId>
+        <groupId>org.apache.camel</groupId>
+        <version>2.18.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>camel-spring-boot-bom-ng</artifactId>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- To be filled in -->
+        </dependencies>
+    </dependencyManagement>
+
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/spring-boot-dm/pom.xml
----------------------------------------------------------------------
diff --git a/spring-boot-dm/pom.xml b/spring-boot-dm/pom.xml
index f9019c0..4b51b3d 100644
--- a/spring-boot-dm/pom.xml
+++ b/spring-boot-dm/pom.xml
@@ -17,6 +17,8 @@
     <modules>
         <module>camel-starter-parent</module>
         <module>camel-spring-boot-bom</module>
+        <module>camel-spring-boot-generator-bom</module>
+        <module>camel-spring-boot-bom-ng</module>
     </modules>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/tooling/maven/bom-generator-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/bom-generator-maven-plugin/pom.xml 
b/tooling/maven/bom-generator-maven-plugin/pom.xml
new file mode 100644
index 0000000..b44815e
--- /dev/null
+++ b/tooling/maven/bom-generator-maven-plugin/pom.xml
@@ -0,0 +1,86 @@
+<?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/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>maven-plugins</artifactId>
+        <groupId>org.apache.camel</groupId>
+        <version>2.18.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>bom-generator-maven-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <name>Camel :: Maven Plugins :: BOM Generator</name>
+    <description>Maven plugin to help generating BOM projects</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>tooling-parent</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-descriptor</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.shared</groupId>
+            <artifactId>maven-dependency-tree</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-container-default</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-utils</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.sonatype.plexus</groupId>
+            <artifactId>plexus-build-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+
+        <!-- logging -->
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+
+    </dependencies>
+
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/BomGeneratorMojo.java
----------------------------------------------------------------------
diff --git 
a/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/BomGeneratorMojo.java
 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/BomGeneratorMojo.java
new file mode 100644
index 0000000..ab2e14e
--- /dev/null
+++ 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/BomGeneratorMojo.java
@@ -0,0 +1,206 @@
+package org.apache.camel.maven.bom.generator;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.util.LinkedList;
+import java.util.List;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Exclusion;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Generate BOM by flattening the current project's dependency management 
section and applying exclusions.
+ *
+ * @goal generate
+ * @phase validate
+ */
+public class BomGeneratorMojo extends AbstractMojo {
+
+    /**
+     * The maven project.
+     *
+     * @parameter property="project"
+     * @required
+     * @readonly
+     */
+    protected MavenProject project;
+
+    /**
+     * The source pom template file.
+     *
+     * @parameter default-value="${basedir}/pom.xml"
+     */
+    protected File sourcePom;
+
+    /**
+     * The pom file.
+     *
+     * @parameter 
default-value="${project.build.directory}/${project.name}-pom.xml"
+     */
+    protected File targetPom;
+
+
+    /**
+     * The user configuration
+     *
+     * @parameter
+     * @readonly
+     */
+    protected DependencySet dependencies;
+
+
+    @Override
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        try {
+            DependencyManagement mng = project.getDependencyManagement();
+
+            List<Dependency> filteredDependencies = 
filter(mng.getDependencies());
+
+            Document pom = loadBasePom();
+
+            // transform
+            overwriteDependencyManagement(pom, filteredDependencies);
+
+            writePom(pom);
+
+        } catch (Exception ex) {
+            throw new MojoExecutionException("Cannot generate the output BOM 
file", ex);
+        }
+    }
+
+    private List<Dependency> filter(List<Dependency> dependencyList) {
+        List<Dependency> outDependencies = new LinkedList<>();
+
+        DependencyMatcher inclusions = new 
DependencyMatcher(dependencies.getIncludes());
+        DependencyMatcher exclusions = new 
DependencyMatcher(dependencies.getExcludes());
+
+        for (Dependency dep : dependencyList) {
+            boolean accept = inclusions.matches(dep) && 
!exclusions.matches(dep);
+            getLog().debug(dep + (accept ? " included in the BOM" : " excluded 
from BOM"));
+
+            if (accept) {
+                outDependencies.add(dep);
+            }
+        }
+
+        return outDependencies;
+    }
+
+    private Document loadBasePom() throws Exception {
+        DocumentBuilder builder = 
DocumentBuilderFactory.newInstance().newDocumentBuilder();
+        Document pom = builder.parse(sourcePom);
+        return pom;
+    }
+
+    private void writePom(Document pom) throws Exception {
+        Transformer transformer = 
TransformerFactory.newInstance().newTransformer();
+        DOMSource source = new DOMSource(pom);
+
+        targetPom.getParentFile().mkdirs();
+
+        try (FileWriter out = new FileWriter(targetPom)) {
+            StreamResult result = new StreamResult(out);
+            transformer.transform(source, result);
+        }
+    }
+
+    private void overwriteDependencyManagement(Document pom, List<Dependency> 
dependencies) throws Exception {
+
+        XPath xpath = XPathFactory.newInstance().newXPath();
+        XPathExpression expr = 
xpath.compile("/project/dependencyManagement/dependencies");
+
+        NodeList nodes = (NodeList) expr.evaluate(pom, XPathConstants.NODESET);
+        if (nodes.getLength() == 0) {
+            throw new IllegalStateException("No dependencies found in the 
dependencyManagement section of the current pom");
+        }
+
+        Node dependenciesSection = nodes.item(0);
+        // cleanup the dependency management section
+        while (dependenciesSection.hasChildNodes()) {
+            Node child = dependenciesSection.getFirstChild();
+            dependenciesSection.removeChild(child);
+        }
+
+        for (Dependency dep : dependencies) {
+            Element dependencyEl = pom.createElement("dependency");
+
+            Element groupIdEl = pom.createElement("groupId");
+            groupIdEl.setTextContent(dep.getGroupId());
+            dependencyEl.appendChild(groupIdEl);
+
+            Element artifactIdEl = pom.createElement("artifactId");
+            artifactIdEl.setTextContent(dep.getArtifactId());
+            dependencyEl.appendChild(artifactIdEl);
+
+            Element versionEl = pom.createElement("version");
+            versionEl.setTextContent(dep.getVersion());
+            dependencyEl.appendChild(versionEl);
+
+            if (!"jar".equals(dep.getType())) {
+                Element typeEl = pom.createElement("type");
+                typeEl.setTextContent(dep.getType());
+                dependencyEl.appendChild(typeEl);
+            }
+
+            if (dep.getClassifier() != null) {
+                Element classifierEl = pom.createElement("classifier");
+                classifierEl.setTextContent(dep.getClassifier());
+                dependencyEl.appendChild(classifierEl);
+            }
+
+            if (dep.getScope() != null && !"compile".equals(dep.getScope())) {
+                Element scopeEl = pom.createElement("scope");
+                scopeEl.setTextContent(dep.getScope());
+                dependencyEl.appendChild(scopeEl);
+            }
+
+            if(dep.getExclusions()!=null) {
+
+                Element exclsEl = pom.createElement("exclusions");
+
+                for(Exclusion e : dep.getExclusions()) {
+                    Element exclEl = pom.createElement("exclusion");
+
+                    Element groupIdExEl = pom.createElement("groupId");
+                    groupIdExEl.setTextContent(e.getGroupId());
+                    exclEl.appendChild(groupIdExEl);
+
+                    Element artifactIdExEl = pom.createElement("artifactId");
+                    artifactIdExEl.setTextContent(e.getArtifactId());
+                    exclEl.appendChild(artifactIdExEl);
+
+                    exclsEl.appendChild(exclEl);
+                }
+
+                dependencyEl.appendChild(exclsEl);
+            }
+
+
+            dependenciesSection.appendChild(dependencyEl);
+        }
+
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencyMatcher.java
----------------------------------------------------------------------
diff --git 
a/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencyMatcher.java
 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencyMatcher.java
new file mode 100644
index 0000000..8bb5651
--- /dev/null
+++ 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencyMatcher.java
@@ -0,0 +1,71 @@
+package org.apache.camel.maven.bom.generator;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.maven.model.Dependency;
+import org.codehaus.plexus.util.SelectorUtils;
+
+/**
+ * A matcher for Maven dependencies based on a collection of rules.
+ */
+public class DependencyMatcher {
+
+    private static final String ARTIFACT_FORMAT = "%s:%s:%s:%s:%s";
+    private static final Pattern ARTIFACT_PATTERN = 
Pattern.compile("(?<groupId>[^:]+):(?<artifactId>[^:]+)(:(?<version>[^:]+))?(:(?<type>[^:]+))?(:(?<classifier>[^:]+))?");
+
+    private Collection<String> selectors;
+
+    public DependencyMatcher(Collection<String> selectors) {
+        this.selectors = selectors;
+    }
+
+    public boolean matches(Dependency artifact) {
+
+        Set<String> expanded = expand(selectors);
+        String coordinates = toCoordinates(artifact);
+
+        for (String e : expanded) {
+            if (SelectorUtils.match(e, coordinates)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private String toCoordinates(Dependency artifact) {
+        return String.format(ARTIFACT_FORMAT, artifact.getGroupId(),
+                artifact.getArtifactId(),
+                artifact.getVersion(),
+                artifact.getType(),
+                artifact.getClassifier());
+    }
+
+    private Set<String> expand(Collection<String> set) {
+        Set<String> result = new HashSet<>();
+        if (set != null) {
+            for (String exclusion : set) {
+                Matcher m = ARTIFACT_PATTERN.matcher(exclusion);
+                if (!m.matches()) {
+                    throw new IllegalArgumentException("Pattern: " + exclusion 
+ " doesn't have the required format.");
+                }
+                String groupId = m.group("groupId");
+                String artifactId = m.group("artifactId");
+                String version = m.group("version");
+                String type = m.group("type");
+                String classifier = m.group("classifier");
+
+                version = version != null ? version : "*";
+                type = type != null ? type : "*";
+                classifier = classifier != null ? classifier : "*";
+
+                result.add(String.format(ARTIFACT_FORMAT, groupId, artifactId, 
version, type, classifier));
+            }
+        }
+        return result;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencySet.java
----------------------------------------------------------------------
diff --git 
a/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencySet.java
 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencySet.java
new file mode 100644
index 0000000..9e0fe80
--- /dev/null
+++ 
b/tooling/maven/bom-generator-maven-plugin/src/main/java/org/apache/camel/maven/bom/generator/DependencySet.java
@@ -0,0 +1,42 @@
+package org.apache.camel.maven.bom.generator;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Inclusion and exclusion rules for artifacts.
+ */
+public class DependencySet {
+
+    private Set<String> includes = new HashSet<>();
+
+    private Set<String> excludes = new HashSet<>();
+
+    public DependencySet() {
+    }
+
+    public Set<String> getIncludes() {
+        return includes;
+    }
+
+    public void setIncludes(Set<String> includes) {
+        this.includes = includes;
+    }
+
+    public Set<String> getExcludes() {
+        return excludes;
+    }
+
+    public void setExcludes(Set<String> excludes) {
+        this.excludes = excludes;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("DependencySet{");
+        sb.append("includes=").append(includes);
+        sb.append(", excludes=").append(excludes);
+        sb.append('}');
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f9c2a954/tooling/maven/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/pom.xml b/tooling/maven/pom.xml
index 731ebc1..4942f81 100644
--- a/tooling/maven/pom.xml
+++ b/tooling/maven/pom.xml
@@ -35,6 +35,7 @@
     <module>camel-eip-documentation-enricher-maven-plugin</module>
     <module>guice-maven-plugin</module>
     <module>camel-api-component-maven-plugin</module>
+    <module>bom-generator-maven-plugin</module>
   </modules>
 
   <!-- Apply to children. -->

Reply via email to