Added maven-checkstyle-plugin to parent POM for code style checks
- Integrate Checkstyle to enforce coding standards across modules.
- Ensure Checkstyle applies to both dmi-service and dmi-stub modules.
- Fixed all code check style issues.
Issue-ID: CPS-2461
Change-Id: Ie84928c1f2e3de549cc8fab2001974369884a831
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
diff --git a/pom.xml b/pom.xml
index b457e23..f8d34c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
============LICENSE_START=======================================================
Copyright (c) 2021-2024 Nordix Foundation.
@@ -18,6 +19,7 @@
SPDX-License-Identifier: Apache-2.0
============LICENSE_END=========================================================
-->
+
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -43,4 +45,84 @@
<name>ncmp-dmi-plugin</name>
<description>DMI Plugin Service</description>
+ <properties>
+ <cps.version>3.5.2</cps.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <!-- Add the Maven Checkstyle Plugin here -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>onap-license</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <configLocation>onap-checkstyle/check-license.xml</configLocation>
+ <includeResources>false</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>false</includeTestResources>
+ <sourceDirectories>
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ </sourceDirectories>
+ <consoleOutput>false</consoleOutput>
+ <violationSeverity>warning</violationSeverity>
+ <failOnViolation>true</failOnViolation>
+ </configuration>
+ </execution>
+ <execution>
+ <id>onap-java-style</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
+ <sourceDirectories>
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ </sourceDirectories>
+ <includeResources>true</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>true</includeTestResources>
+ <consoleOutput>false</consoleOutput>
+ <violationSeverity>warning</violationSeverity>
+ <failOnViolation>true</failOnViolation>
+ </configuration>
+ </execution>
+ <execution>
+ <id>cps-java-style</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <configLocation>cps-java-style.xml</configLocation>
+ <sourceDirectories>
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ </sourceDirectories>
+ <includeResources>true</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>true</includeTestResources>
+ <consoleOutput>true</consoleOutput>
+ <violationSeverity>warning</violationSeverity>
+ <failOnViolation>true</failOnViolation>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>${cps.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
</project>