Reducing onboarding backend maven build time

Reducing onboarding backend maven build time

Change-Id: I3fe5f8d6d9b21591018243d16809451c6b8c2d14
Issue-ID: SDC-1189
Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
diff --git a/onboarding/pom.xml b/onboarding/pom.xml
index f2569a0..afc452e 100644
--- a/onboarding/pom.xml
+++ b/onboarding/pom.xml
@@ -22,7 +22,7 @@
         <!-- Maven plugin versions -->
         <jacoco.version>0.7.9</jacoco.version>
         <mvn.assembly.version>2.1</mvn.assembly.version>
-        <mvn.compiler.version>2.5.1</mvn.compiler.version>
+        <mvn.compiler.version>3.7.0</mvn.compiler.version>
         <mvn.deploy.version>2.4</mvn.deploy.version>
         <mvn.hub.version>1.4.0</mvn.hub.version>
         <mvn.install.version>2.3.1</mvn.install.version>
@@ -127,6 +127,8 @@
                 <artifactId>maven-pmd-plugin</artifactId>
                 <version>3.8</version>
                 <configuration>
+                    <analysisCache>true</analysisCache>
+                    <analysisCacheLocation>${project.build.directory}/pmd/pmd.cache</analysisCacheLocation>
                     <aggregate>false</aggregate>
                     <includeTests>true</includeTests>
                     <linkXRef>false</linkXRef>
@@ -163,7 +165,50 @@
                     </dependency>
                 </dependencies>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                    <filesets>
+                        <fileset>
+                            <directory>${project.build.directory}</directory>
+                            <excludes>
+                                <exclude>test-classes/**</exclude>
+                                <exclude>pmd/**</exclude>
+                                <exclude>maven-status/**</exclude>
+                            </excludes>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${mvn.surefire.version}</version>
+                <configuration>
+                    <forkCount>0</forkCount>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <additionalClasspathElements>
+                        <additionalClasspathElement>${project.build.directory}/../src/test/resources</additionalClasspathElement>
+                    </additionalClasspathElements>
+                    <systemPropertyVariables>
+                        <logback.configurationFile>src/test/resources/logback-test.xml</logback.configurationFile>
+                        <artifactgenerator.config>${project.basedir}/src/test/resources/config/Artifact-Generator.properties</artifactgenerator.config>
+                        <config.location>${project.basedir}/configuration</config.location>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
         </plugins>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <excludes>
+                    <exclude>**/*</exclude>
+                </excludes>
+            </testResource>
+        </testResources>
     </build>
 
 </project>