Fix checkstyle errors when building archetype-generated apps

Checkstyle validation is now enabled by default in onos-dependencies
(archetypes' parent pom). We also add a reference to the archetypes' pom
to disable checkstyle, if needed.

Change-Id: I9b6e6cecf2d704f52ec1f118eae2aafd03cf0b9a
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 acded36..ba79393 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
@@ -19,7 +19,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -45,4 +47,18 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/tools/package/archetypes/api/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/api/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/api/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
diff --git a/tools/package/archetypes/bundle/pom.xml b/tools/package/archetypes/bundle/pom.xml
index 4b2d913..31c19f3 100644
--- a/tools/package/archetypes/bundle/pom.xml
+++ b/tools/package/archetypes/bundle/pom.xml
@@ -14,18 +14,34 @@
   ~ 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/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<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-archetypes</artifactId>
-    <version>2.2.1-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-archetypes</artifactId>
+        <version>2.2.1-SNAPSHOT</version>
+    </parent>
 
-  <artifactId>onos-bundle-archetype</artifactId>
-  <packaging>maven-archetype</packaging>
+    <artifactId>onos-bundle-archetype</artifactId>
+    <packaging>maven-archetype</packaging>
 
-  <description>ONOS OSGi bundle archetype</description>
+    <description>ONOS OSGi bundle archetype</description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
+        </plugins>
+    </build>
 
 </project>
diff --git a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/AppComponent.java b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/AppComponent.java
index c2fc6428..68d35f1 100644
--- a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/AppComponent.java
+++ b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/AppComponent.java
@@ -18,7 +18,6 @@
  */
 package ${package};
 
-import com.google.common.collect.ImmutableSet;
 import org.onosproject.cfg.ComponentConfigService;
 import org.osgi.service.component.ComponentContext;
 import org.osgi.service.component.annotations.Activate;
diff --git a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
diff --git a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/test/java/AppComponentTest.java b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/test/java/AppComponentTest.java
index 05e712d..bcb3bdf 100644
--- a/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/test/java/AppComponentTest.java
+++ b/tools/package/archetypes/bundle/src/main/resources/archetype-resources/src/test/java/AppComponentTest.java
@@ -21,11 +21,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onosproject.cfg.ComponentConfigService;
 import org.onosproject.cfg.ComponentConfigAdapter;
-import org.onosproject.cfg.ConfigProperty;
-
-import java.util.Set;
 
 /**
  * Set of tests of the ONOS application component.
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 e98fdcd..5a8d65a 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
@@ -19,7 +19,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -84,6 +86,15 @@
                     </instructions>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java b/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java
index b9ac3ec..19f07dc 100644
--- a/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java
+++ b/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java
@@ -20,7 +20,7 @@
 import org.onosproject.cli.AbstractShellCommand;
 
 /**
- * Sample Apache Karaf CLI command
+ * Sample Apache Karaf CLI command.
  */
 @Service
 @Command(scope = "onos", name = "sample",
diff --git a/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
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 3abcc18..8a159d0 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
@@ -19,7 +19,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -143,6 +145,15 @@
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/AppWebResource.java b/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/AppWebResource.java
index 0438d39..89f596f 100644
--- a/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/AppWebResource.java
+++ b/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/AppWebResource.java
@@ -25,8 +25,6 @@
 import javax.ws.rs.Path;
 import javax.ws.rs.core.Response;
 
-import static org.onlab.util.Tools.nullIsNotFound;
-
 /**
  * Sample web resource.
  */
diff --git a/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/rest/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
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 3bb5fdd..0ec953f 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
@@ -19,7 +19,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -77,6 +79,15 @@
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/ui/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
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 05da40c..6aa5e58 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
@@ -26,7 +26,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -48,4 +50,18 @@
         <module>web/${artifactId}-gui</module>
     </modules>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
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 7775946..3551265 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
@@ -20,7 +20,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -78,6 +80,15 @@
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
index 312478c..33634b8 100644
--- a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
+++ b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/AppUiTableMessageHandler.java
@@ -1,6 +1,6 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
+#set($symbol_pound='#')
+#set($symbol_dollar='$')
+#set($symbol_escape='\' )
 /*
  * Copyright ${year}-present Open Networking Foundation
  *
@@ -27,7 +27,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.lang.Override;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -53,7 +52,7 @@
     private static final String COMMENT = "comment";
     private static final String RESULT = "result";
 
-    private static final String[] COLUMN_IDS = { ID, LABEL, CODE };
+    private static final String[] COLUMN_IDS = {ID, LABEL, CODE};
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -100,7 +99,7 @@
 
             // fake data for demonstration purposes...
             List<Item> items = getItems();
-            for (Item item: items) {
+            for (Item item : items) {
                 populateRow(tm.addRow(), item);
             }
         }
@@ -190,8 +189,16 @@
             this.code = code;
         }
 
-        String id() { return id; }
-        String label() { return label; }
-        int code() { return code; }
+        String id() {
+            return id;
+        }
+
+        String label() {
+            return label;
+        }
+
+        int code() {
+            return code;
+        }
     }
 }
diff --git a/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/uitab/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};
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 412db9e..bf2a4ea 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
@@ -20,7 +20,9 @@
   ~ 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/xsd/maven-4.0.0.xsd">
+<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>
@@ -78,6 +80,15 @@
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <!-- Uncomment to disable checkstyle validation
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                -->
+            </plugin>
         </plugins>
     </build>
 
diff --git a/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/src/main/java/package-info.java b/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/src/main/java/package-info.java
new file mode 100644
index 0000000..3d2d640
--- /dev/null
+++ b/tools/package/archetypes/uitopo/src/main/resources/archetype-resources/src/main/java/package-info.java
@@ -0,0 +1,23 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Copyright ${year}-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.
+ */
+
+/**
+ * The ${artifactId} application.
+ */
+package ${package};