Plugin to format/validate POM
[ccsdk/cds.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 3ffafbe..8350e1e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -16,35 +16,32 @@ 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>
 
     <parent>
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.5.0-SNAPSHOT</version>
         <relativePath/>
     </parent>
 
-    <modelVersion>4.0.0</modelVersion>
-
     <groupId>org.onap.ccsdk.cds</groupId>
     <artifactId>parent</artifactId>
-    <version>0.5.0-SNAPSHOT</version>
+    <version>0.7.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>cds-parent</name>
     <description>CCSDK Controller Design Studio</description>
+    <url>https://wiki.onap.org</url>
+    <organization>
+        <name>ONAP</name>
+    </organization>
 
     <modules>
         <module>cds-ui</module>
-        <module>components</module>
         <module>ms</module>
     </modules>
 
-    <url>https://wiki.onap.org</url>
-    <organization>
-        <name>ONAP</name>
-    </organization>
-
     <properties>
         <!--Don't set any language to let sonar enable multi-language support-->
         <sonar.language/>
@@ -54,15 +51,14 @@ limitations under the License.
         <sonar.tests>src/test</sonar.tests>
         <!--Only include java and kt files to the scan-->
         <sonar.inclusions>**/*.java,**/*.kt</sonar.inclusions>
-        <!--Specify path to load jacoco XLM report, as Sonar can't load Kotlin coverage from binary report.
-        Note: coverage for now is invalid and is failing to load because of:
-        "Cannot import coverage information for file '{file}', coverage data is invalid."
-        see https://github.com/jacoco/jacoco/issues/763
-        That issue has been fixed in 0.8.3 , so we override the default ONAP
-        version here to pick up that fix -->
+        <!--Specify path to load jacoco XLM report, as Sonar can't load Kotlin coverage from binary report-->
         <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
         </sonar.coverage.jacoco.xmlReportPaths>
         <jacoco.version>0.8.3</jacoco.version>
+       
+       <!-- Properties for POM Format -->
+       <format.skipValidate>false</format.skipValidate>
+        <format.skipExecute>true</format.skipExecute>
     </properties>
 
     <build>
@@ -72,6 +68,35 @@ limitations under the License.
                 <artifactId>jacoco-maven-plugin</artifactId>
                 <version>${jacoco.version}</version>
             </plugin>
+
+           <!-- Plugin to Format/Validate POM Files -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>tidy-maven-plugin</artifactId>
+                <version>1.1.0</version>
+                <executions>
+                    <execution>
+                        <id>format-pom</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>pom</goal>
+                        </goals>
+                        <configuration>
+                            <skip>${format.skipExecute}</skip>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>validate-pom</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <skip>${format.skipValidate}</skip>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 
@@ -107,6 +132,14 @@ limitations under the License.
                 </plugins>
             </build>
         </profile>
-    </profiles>
 
+       <!-- Profile to format skip validate or execute -->
+       <profile>
+            <id>format</id>
+            <properties>
+                <format.skipValidate>true</format.skipValidate>
+                <format.skipExecute>false</format.skipExecute>
+            </properties>
+        </profile>
+    </profiles>
 </project>