Revamp support for building third-party apps via maven

- Publish onos-dependencies (autogenerated from deps.json). With most
  3rd-party dependencies listed as <dependencyManagement> to avoid
  version conflicts, and a minimal set listed as <dependencies> to
  simplify child poms. Similarly, we provide a number of plugins already
  configured as <pluginManagement> to support the whole life-cycle of
  apps (from build, to reporting and release).
- Update Maven plugins to work with JDK 11 (checkstyle, pmd, etc.)
- Publish onos-build-conf (with common checkstyle and pmd confs)
- Removed unused checkstyle code
- Fix OSGi version mismatch in deps.json to consistently depend on
  release 6 (the one supported by Karaf 4)
- Update/simplify archetypes to use onos-dependencies as the parent pom

Change-Id: Ic09b34e13fb49eb3d96df623b53a3617bbf7b7e4
diff --git a/tools/package/archetypes/api/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/api/src/main/resources/META-INF/maven/archetype-metadata.xml
index e832eb7..4a0a850 100644
--- a/tools/package/archetypes/api/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/api/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -27,4 +27,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/api/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/api/src/main/resources/archetype-resources/pom.xml
index 3b6b760..acded36 100644
--- a/tools/package/archetypes/api/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/api/src/main/resources/archetype-resources/pom.xml
@@ -22,6 +22,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -30,37 +36,13 @@
     <description>ONOS OSGi API bundle archetype</description>
     <url>http://onosproject.org</url>
 
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.3.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.7.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>
diff --git a/tools/package/archetypes/api/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/api/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/api/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/api/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/bundle/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/bundle/src/main/resources/META-INF/maven/archetype-metadata.xml
index 3461339..ee3f072 100644
--- a/tools/package/archetypes/bundle/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/bundle/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -33,4 +33,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/pom.xml
index 3f4a6be..08f248b 100644
--- a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/pom.xml
@@ -22,6 +22,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -31,8 +37,6 @@
     <url>http://onosproject.org</url>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
         <!-- Uncomment to generate ONOS app from this module.
         <onos.app.name>org.foo.app</onos.app.name>
         <onos.app.title>Foo App</onos.app.title>
@@ -48,125 +52,37 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-misc</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <version>1.7.25</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>22.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.9.5</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>    </dependencies>
+    </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.1</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/bundle/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/bundle/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/bundle/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/bundle/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml
index c77ad49..a6619f2 100644
--- a/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -33,4 +33,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml
index 3da807a..e98fdcd 100644
--- a/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml
@@ -22,6 +22,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -30,29 +36,19 @@
     <description>ONOS OSGi bundle archetype</description>
     <url>http://onosproject.org</url>
 
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -71,21 +67,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <version>5.0.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.karaf.shell</groupId>
             <artifactId>org.apache.karaf.shell.console</artifactId>
-            <version>4.2.1</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>
@@ -95,34 +78,12 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
                 <configuration>
                     <instructions>
                         <Karaf-Commands>${package}</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/rest/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/rest/src/main/resources/META-INF/maven/archetype-metadata.xml
index 62275f5..f6bfca2 100644
--- a/tools/package/archetypes/rest/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/rest/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -33,4 +33,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/rest/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/rest/src/main/resources/archetype-resources/pom.xml
index e6ee965..3abcc18 100644
--- a/tools/package/archetypes/rest/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/rest/src/main/resources/archetype-resources/pom.xml
@@ -22,6 +22,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -31,9 +37,6 @@
     <url>http://onosproject.org</url>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
-
         <web.context>/onos/${artifactId}</web.context>
         <api.version>1.0.0</api.version>
         <api.title>Sample app REST API</api.title>
@@ -48,19 +51,14 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -94,46 +92,30 @@
         <dependency>
             <groupId>javax.ws.rs</groupId>
             <artifactId>javax.ws.rs-api</artifactId>
-            <version>2.1</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.containers</groupId>
             <artifactId>jersey-container-servlet</artifactId>
-            <version>2.26</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
-            <version>2.9.5</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-            <version>2.9.5</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <version>5.0.0</version>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
+
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
             <artifactId>org.apache.karaf.shell.console</artifactId>
-            <version>4.2.1</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>
@@ -143,8 +125,6 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
                 <configuration>
                     <instructions>
                         <_wab>src/main/webapp/</_wab>
@@ -152,9 +132,6 @@
                             WEB-INF/classes/apidoc/swagger.json=target/swagger.json,
                             {maven-resources}
                         </Include-Resource>
-                        <Bundle-SymbolicName>
-                            ${project.groupId}.${project.artifactId}
-                        </Bundle-SymbolicName>
                         <Import-Package>
                             *,org.glassfish.jersey.servlet
                         </Import-Package>
@@ -163,52 +140,8 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.0</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml
index 5946d3f..8e61058 100644
--- a/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/ui/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -35,4 +35,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml
index 460e67a..3bb5fdd 100644
--- a/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/ui/src/main/resources/archetype-resources/pom.xml
@@ -22,6 +22,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -31,8 +37,6 @@
     <url>http://onosproject.org</url>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
         <!-- Uncomment to generate ONOS app from this module.
         <onos.app.name>org.foo.app</onos.app.name>
         <onos.app.title>Foo App</onos.app.title>
@@ -48,19 +52,14 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -70,70 +69,13 @@
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.0</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/ui/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/ui2/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/ui2/src/main/resources/META-INF/maven/archetype-metadata.xml
index 1d24909..92f81d8 100644
--- a/tools/package/archetypes/ui2/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/ui2/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -61,4 +61,9 @@
             <include>ng-test.sh</include>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/ui2/src/main/resources/archetype-resources/app/pom.xml b/tools/package/archetypes/ui2/src/main/resources/archetype-resources/app/pom.xml
index 4a7c9fd..18d70f3 100644
--- a/tools/package/archetypes/ui2/src/main/resources/archetype-resources/app/pom.xml
+++ b/tools/package/archetypes/ui2/src/main/resources/archetype-resources/app/pom.xml
@@ -46,19 +46,14 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -68,70 +63,13 @@
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.0</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/ui2/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/ui2/src/main/resources/archetype-resources/pom.xml
index dc2d329..05da40c 100644
--- a/tools/package/archetypes/ui2/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/ui2/src/main/resources/archetype-resources/pom.xml
@@ -29,6 +29,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -37,11 +43,6 @@
     <description>ONOS OSGi GUI2 Custom-View bundle archetype</description>
     <url>http://onosproject.org</url>
 
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
-    </properties>
-
     <modules>
         <module>app</module>
         <module>web/${artifactId}-gui</module>
diff --git a/tools/package/archetypes/ui2/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/ui2/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/ui2/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/ui2/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/uitab/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/uitab/src/main/resources/META-INF/maven/archetype-metadata.xml
index 4b4b522..935ea83 100644
--- a/tools/package/archetypes/uitab/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/uitab/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -36,4 +36,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/pom.xml
index 75e9b29..7775946 100644
--- a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/pom.xml
@@ -23,6 +23,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -32,8 +38,6 @@
     <url>http://onosproject.org</url>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
         <!-- Uncomment to generate ONOS app from this module.
         <onos.app.name>org.foo.app</onos.app.name>
         <onos.app.title>Foo App</onos.app.title>
@@ -49,19 +53,14 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -71,70 +70,13 @@
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.0</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/uitab/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/uitab/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/uitab/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/uitab/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/archetypes/uitopo/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/package/archetypes/uitopo/src/main/resources/META-INF/maven/archetype-metadata.xml
index 01ec6f2..20cb7c4 100644
--- a/tools/package/archetypes/uitopo/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/package/archetypes/uitopo/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -36,4 +36,9 @@
             </includes>
         </fileSet>
     </fileSets>
+    <requiredProperties>
+        <requiredProperty key="onosVersion">
+            <defaultValue>2.2.1-SNAPSHOT</defaultValue>
+        </requiredProperty>
+    </requiredProperties>
 </archetype-descriptor>
diff --git a/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/pom.xml b/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/pom.xml
index bb5d5a2..412db9e 100644
--- a/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/pom.xml
+++ b/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/pom.xml
@@ -23,6 +23,12 @@
 <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">
     <modelVersion>4.0.0</modelVersion>
 
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-dependencies</artifactId>
+        <version>${onosVersion}</version>
+    </parent>
+
     <groupId>${groupId}</groupId>
     <artifactId>${artifactId}</artifactId>
     <version>${version}</version>
@@ -32,8 +38,6 @@
     <url>http://onosproject.org</url>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <onos.version>2.2.1-SNAPSHOT</onos.version>
         <!-- Uncomment to generate ONOS app from this module.
         <onos.app.name>org.foo.app</onos.app.name>
         <onos.app.title>Foo App</onos.app.title>
@@ -49,19 +53,14 @@
             <groupId>org.onosproject</groupId>
             <artifactId>onos-api</artifactId>
             <version>${onos.version}</version>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-osgi</artifactId>
             <version>${onos.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -71,70 +70,13 @@
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.5.0</version>
-                <extensions>true</extensions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.0</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.0</version>
-                <configuration>
-                    <supportedProjectTypes>
-                        <supportedProjectType>bundle</supportedProjectType>
-                        <supportedProjectType>war</supportedProjectType>
-                    </supportedProjectTypes>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
-                <version>2.0</version>
-                <executions>
-                    <execution>
-                        <id>cfg</id>
-                        <phase>generate-resources</phase>
-                        <goals>
-                            <goal>cfg</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>swagger</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>swagger</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>app</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>app</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
diff --git a/tools/package/archetypes/uitopo/src/test/resources/projects/basic/archetype.properties b/tools/package/archetypes/uitopo/src/test/resources/projects/basic/archetype.properties
index 24316bf..7e7c139 100644
--- a/tools/package/archetypes/uitopo/src/test/resources/projects/basic/archetype.properties
+++ b/tools/package/archetypes/uitopo/src/test/resources/projects/basic/archetype.properties
@@ -19,3 +19,4 @@
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+onosVersion=1.0
diff --git a/tools/package/dependencies/BUILD b/tools/package/dependencies/BUILD
new file mode 100644
index 0000000..63adf9c
--- /dev/null
+++ b/tools/package/dependencies/BUILD
@@ -0,0 +1,69 @@
+load("//tools/build/bazel:pom_file.bzl", "dependencies_pom")
+load(
+    "//tools/build/bazel:variables.bzl",
+    "DEFAULT_JAVA_VERSION",
+    "ONOS_ARTIFACT_BASE",
+    "ONOS_GROUP_ID",
+    "ONOS_VERSION",
+)
+load(
+    "//tools/build/bazel:generate_workspace.bzl",
+    "CLI",
+    "CORE_DEPS",
+    "JACKSON",
+    "JAXB",
+    "KRYO",
+    "REST",
+    "TEST",
+)
+
+# Listed in the <dependencyManagement> section of the generated pom
+DEPS = [
+    d
+    for d in CORE_DEPS + JAXB + JACKSON + KRYO +
+             CLI + REST + TEST
+    # Keep only third-party (external) ones.
+    if d.startswith("@")
+] + [
+    "@org_apache_karaf_shell_console//jar",
+    "@org_osgi_cmpn//jar",
+    "@jersey_container_servlet//jar",
+]
+
+# Listed in the <dependencies> section with scope 'provided'
+DEPS_PROVIDED = [
+    "@com_google_guava_guava//jar",
+    "@slf4j_api//jar",
+    "@osgi_core//jar",
+    "@org_osgi_cmpn//jar",
+    "@org_osgi_util_promise//jar",
+    "@org_osgi_service_component//jar",
+    "@org_osgi_service_component_annotations//jar",
+    "@org_osgi_service_metatype_annotations//jar",
+]
+
+# Listed in the <dependencies> section with scope 'test'.
+DEPS_TEST = [d for d in TEST if d.startswith("@")]
+
+VARS = [
+    "ONOS_VERSION=" + ONOS_VERSION,
+    "ONOS_GROUP_ID=" + ONOS_GROUP_ID,
+    "ONOS_ARTIFACT_BASE=" + ONOS_ARTIFACT_BASE,
+    "JAVA_VERSION=" + DEFAULT_JAVA_VERSION,
+]
+
+dependencies_pom(
+    name = "onos-dependencies-pom",
+    deps_provided = DEPS_PROVIDED,
+    deps_test = DEPS_TEST,
+    pom_template = "template.pom",
+    vars = VARS,
+    deps = DEPS,
+)
+
+# An empty jar, so we can re-use onos-publish logic.
+java_library(
+    name = "onos-dependencies",
+    resources = ["empty.txt"],
+    visibility = ["//visibility:public"],
+)
diff --git a/tools/package/dependencies/empty.txt b/tools/package/dependencies/empty.txt
new file mode 100644
index 0000000..4c5974d7
--- /dev/null
+++ b/tools/package/dependencies/empty.txt
@@ -0,0 +1 @@
+This jar is intentionally left empty
\ No newline at end of file
diff --git a/tools/package/dependencies/template.pom b/tools/package/dependencies/template.pom
new file mode 100644
index 0000000..b886639
--- /dev/null
+++ b/tools/package/dependencies/template.pom
@@ -0,0 +1,386 @@
+<!--
+ ~ Copyright 2019-present Open Networking Foundation
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~     http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<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>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-base</artifactId>
+        <version>1</version>
+    </parent>
+
+    <artifactId><!-- ONOS_ARTIFACT_BASE -->dependencies</artifactId>
+    <groupId><!-- ONOS_GROUP_ID --></groupId>
+    <packaging>pom</packaging>
+    <version><!-- ONOS_VERSION --></version>
+    <name>${project.artifactId}</name>
+    <description>ONOS shared dependencies for third-party apps</description>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <karaf.version>4.2.6</karaf.version>
+        <maven.version.min>3.3.9</maven.version.min>
+        <java.version.min><!-- JAVA_VERSION --></java.version.min>
+        <onos.version><!-- ONOS_VERSION --></onos.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- DEPS_MGMT -->
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- DEPS -->
+    </dependencies>
+
+    <build>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>3.8.0</version>
+                    <configuration>
+                        <release>11</release>
+                    </configuration>
+                    <inherited>true</inherited>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>3.0.0-M2</version>
+                    <executions>
+                        <execution>
+                            <id>enforce-maven</id>
+                            <goals>
+                                <goal>enforce</goal>
+                            </goals>
+                            <configuration>
+                                <rules>
+                                    <requireMavenVersion>
+
+                                        <version>[${maven.version.min},)</version>
+                                    </requireMavenVersion>
+                                </rules>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>enforce-java</id>
+                            <goals>
+                                <goal>enforce</goal>
+                            </goals>
+                            <configuration>
+                                <rules>
+                                    <requireJavaVersion>
+                                        <version>[${java.version.min},)</version>
+                                    </requireJavaVersion>
+                                </rules>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-clean-plugin</artifactId>
+                    <version>3.1.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>3.0.0-M1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-install-plugin</artifactId>
+                    <version>3.0.0-M1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-site-plugin</artifactId>
+                    <version>3.8.2</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-project-info-reports-plugin</artifactId>
+                    <version>3.0.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>3.0.0-M3</version>
+                    <configuration>
+                        <redirectTestOutputToFile>
+                            true
+                        </redirectTestOutputToFile>
+                        <printSummary>
+                            true
+                        </printSummary>
+                        <excludedGroups>
+                            org.onlab.junit.IntegrationTest
+                        </excludedGroups>
+                        <rerunFailingTestsCount>
+                            1
+                        </rerunFailingTestsCount>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>3.1.1</version>
+                    <configuration>
+                        <tags>
+                            <tag>
+                                <name>onos.rsModel</name>
+                                <placement>m</placement>
+                                <head>Json model for REST api:</head>
+                            </tag>
+                        </tags>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>3.2.0</version>
+                    <configuration>
+                        <skipIfEmpty>true</skipIfEmpty>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>default</id>
+                            <goals>
+                                <goal>test-jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <version>3.0.0</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.onosproject</groupId>
+                            <artifactId>onos-build-conf</artifactId>
+                            <version>${onos.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>com.puppycrawl.tools</groupId>
+                            <artifactId>checkstyle</artifactId>
+                            <version>8.10</version>
+                        </dependency>
+                    </dependencies>
+                    <configuration>
+                        <configLocation>
+                            onos/checkstyle-mvn.xml
+                        </configLocation>
+                        <suppressionsLocation>
+                            onos/suppressions.xml
+                        </suppressionsLocation>
+                        <headerLocation>
+                            onos/onos-java.header
+                        </headerLocation>
+                        <failsOnError>false</failsOnError>
+                        <logViolationsToConsole>true</logViolationsToConsole>
+                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
+                        <includeResources>false</includeResources>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>validate-checkstyle</id>
+                            <phase>verify</phase>
+                            <goals>
+                                <goal>check</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-pmd-plugin</artifactId>
+                    <version>3.12.0</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.onosproject</groupId>
+                            <artifactId>onos-build-conf</artifactId>
+                            <version>${onos.version}</version>
+                        </dependency>
+                    </dependencies>
+                    <executions>
+                        <execution>
+                            <id>validate-pmd</id>
+                            <phase>verify</phase>
+                            <goals>
+                                <!-- Uncomment this goal to make the build fail on pmd errors -->
+                                <!-- <goal>check</goal> -->
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <rulesets>
+                            <ruleset>onos/pmd.xml</ruleset>
+                        </rulesets>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.jacoco</groupId>
+                    <artifactId>jacoco-maven-plugin</artifactId>
+                    <version>0.8.5</version>
+                    <executions>
+                        <execution>
+                            <id>default-prepare-agent</id>
+                            <goals>
+                                <goal>prepare-agent</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <id>default-report</id>
+                            <phase>prepare-package</phase>
+                            <goals>
+                                <goal>report</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>3.1.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>maven-bundle-plugin</artifactId>
+                    <version>4.1.0</version>
+                    <extensions>true</extensions>
+                    <configuration>
+                        <instructions>
+                            <Bundle-SymbolicName>
+                                ${project.groupId}.${project.artifactId}
+                            </Bundle-SymbolicName>
+                            <_dsannotations-options>inherit</_dsannotations-options>
+                        </instructions>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>3.1.0</version>
+                    <executions>
+                        <execution>
+                            <id>attach-sources</id>
+                            <goals>
+                                <goal>jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-shade-plugin</artifactId>
+                    <version>3.1.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>com.github.spotbugs</groupId>
+                    <artifactId>spotbugs-maven-plugin</artifactId>
+                    <version>3.1.12</version>
+                    <configuration>
+                        <effort>Max</effort>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.onosproject</groupId>
+                    <artifactId>onos-maven-plugin</artifactId>
+                    <!-- This version needs to be updated manually when changes
+                    are made to onos-maven-plugin -->
+                    <version>2.2</version>
+                    <executions>
+                        <execution>
+                            <id>cfg</id>
+                            <phase>generate-resources</phase>
+                            <goals>
+                                <goal>cfg</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <id>swagger</id>
+                            <phase>generate-sources</phase>
+                            <goals>
+                                <goal>swagger</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <id>app</id>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>app</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.karaf.tooling</groupId>
+                    <artifactId>karaf-maven-plugin</artifactId>
+                    <version>${karaf.version}</version>
+                    <extensions>true</extensions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-pmd-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </reporting>
+
+</project>