Fix issues in yang recompilation

Change-Id: I0efec68481b174e63f6a3ec587726bfaf27cfd84
diff --git a/apps/tenbi/yangmodel/pom.xml b/apps/tenbi/yangmodel/pom.xml
index a2436d6..03b2f4e 100644
--- a/apps/tenbi/yangmodel/pom.xml
+++ b/apps/tenbi/yangmodel/pom.xml
@@ -56,6 +56,31 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>onos-yang-plugin-workaround</id>
+                        <!-- yang plugin cannot handle non-clean compilation -->
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>target/generated-sources</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <plugin>
                 <groupId>com.google.code.maven-replacer-plugin</groupId>
                 <artifactId>replacer</artifactId>
diff --git a/apps/yms/ut/pom.xml b/apps/yms/ut/pom.xml
index 57af901..a4b25e7 100644
--- a/apps/yms/ut/pom.xml
+++ b/apps/yms/ut/pom.xml
@@ -90,6 +90,31 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>onos-yang-plugin-workaround</id>
+                        <!-- yang plugin cannot handle non-clean compilation -->
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>target/generated-sources</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 </project>
diff --git a/drivers/microsemi/ea1000driver/pom.xml b/drivers/microsemi/ea1000driver/pom.xml
index 63afc30..3ba11e8 100644
--- a/drivers/microsemi/ea1000driver/pom.xml
+++ b/drivers/microsemi/ea1000driver/pom.xml
@@ -93,8 +93,6 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
-                <configuration>
-                </configuration>
             </plugin>
         </plugins>
     </build>
diff --git a/drivers/microsemi/ea1000yang/pom.xml b/drivers/microsemi/ea1000yang/pom.xml
index e60bf4a..edf21d6 100644
--- a/drivers/microsemi/ea1000yang/pom.xml
+++ b/drivers/microsemi/ea1000yang/pom.xml
@@ -25,6 +25,7 @@
         <onos.app.url>http://onosproject.org</onos.app.url>
         <onos.app.readme>For various Microsemi Devices including EdgeAssure
             1000 SFP-NID</onos.app.readme>
+        <onos.yang.version>1.11</onos.yang.version>
     </properties>
 
 
@@ -38,13 +39,13 @@
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-yang-utils-generator</artifactId>
-            <version>1.11</version>
+            <version>${onos.yang.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onos-yang-datamodel</artifactId>
-            <version>1.11</version>
+            <version>${onos.yang.version}</version>
         </dependency>
 
         <dependency>
@@ -80,7 +81,7 @@
             <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-yang-maven-plugin</artifactId>
-                <version>1.11</version>
+                <version>${onos.yang.version}</version>
                 <executions>
                     <execution>
                         <configuration>
@@ -104,6 +105,30 @@
             </plugin>
 
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>onos-yang-plugin-workaround</id>
+                        <!-- yang plugin cannot handle non-clean compilation -->
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>target/generated-sources</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
                 <groupId>org.jacoco</groupId>
                 <artifactId>jacoco-maven-plugin</artifactId>
                 <configuration>
diff --git a/lib/pom.xml b/lib/pom.xml
index 39c33fd..0079be7 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -488,7 +488,7 @@
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
-                    <version>3.2.0</version>
+                    <version>3.3.0</version>
                     <extensions>true</extensions>
                     <configuration>
                         <niceManifest>true</niceManifest>
@@ -623,7 +623,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
-                <version>3.7</version>
+                <version>3.8</version>
                 <configuration>
                     <excludes>
                     </excludes>