Update pom for sonar
[aai/model-loader.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 2395e53..d217ba8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
                <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
+              <sonar.language>java</sonar.language>
+              <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+              <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
+              <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
+              <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
+              <sonar.projectVersion>${project.version}</sonar.projectVersion>
        </properties>
 
        <dependencies>
                          <id>ecomp-snapshots</id>
                           <name>ECOMP Snapshot Repository</name>
                          <url>https://nexus.openecomp.org/content/repositories/snapshots/</url>
-                          <snapshots>
-            <updatePolicy>always</updatePolicy>
-        </snapshots>
-        <releases>
-            <updatePolicy>always</updatePolicy>
-        </releases>
                   </repository>
 
           </repositories>
        
        <build>
                <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.7</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-docker-file</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>target</outputDirectory>
+                                                       <overwrite>true</overwrite>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>${basedir}/src/main/docker</directory>
+                                                                       <filtering>true</filtering>
+                                                                       <includes>
+                                                                               <include>**/*</include>
+                                                                       </includes>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>com.spotify</groupId>
+                               <artifactId>docker-maven-plugin</artifactId>
+                               <version>0.4.11</version>
+                               <configuration>         
+                                       <verbose>true</verbose>
+                                       <serverId>docker-hub</serverId>
+                                       <imageName>${docker.push.registry}/openecomp/${project.artifactId}</imageName>                                  
+                                       <dockerDirectory>${docker.location}</dockerDirectory>
+                                       <imageTags>
+                                               <imageTag>${docker.imagetag}</imageTag>
+                                               <imageTag>latest</imageTag>
+                                       </imageTags>
+                                       <forceTags>true</forceTags>
+                               </configuration>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <version>2.12.4</version>
                                <configuration>
-                                       <argLine>-javaagent:${project.build.directory}/agents/powermock-javaagent.jar
-                                               -noverify</argLine>
+                                  <argLine>-noverify ${argLine}</argLine>
                                </configuration>
                        </plugin>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>3.1</version>
                        </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-resources-plugin</artifactId>
-                               <version>2.7</version>
-                               <executions>
-                                       <execution>
-                                               <id>copy-docker-file</id>
-                                               <phase>package</phase>
-                                               <goals>
-                                                       <goal>copy-resources</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <outputDirectory>target</outputDirectory>
-                                                       <overwrite>true</overwrite>
-                                                       <resources>
-                                                               <resource>
-                                                                       <directory>${basedir}/src/main/docker</directory>
-                                                                       <filtering>true</filtering>
-                                                                       <includes>
-                                                                               <include>**/*</include>
-                                                                       </includes>
-                                                               </resource>
-                                                       </resources>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-                       <plugin>
-                               <groupId>com.spotify</groupId>
-                               <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.4.11</version>
-                               <configuration>         
-                                       <imageName>${docker.registry}/ecomp/${project.artifactId}</imageName>                                   
-                                       <imageTags>
-                                               <imageTag>${docker.imagetag}</imageTag>
-                                               <imageTag>latest</imageTag>
-                                       </imageTags>
-                                       <forceTags>true</forceTags>
-                               </configuration>
-                       </plugin>
                
                        <!-- Checkstyle plugin - used to report on compliance with -->
                        <!-- the Google style guide. -->
                 </execution>
               </executions>
             </plugin>
-               </plugins>
+             <plugin>
+               <groupId>org.apache.maven.plugins</groupId>
+               <artifactId>maven-deploy-plugin</artifactId>                    
+               <configuration>
+               <skip>true</skip>
+               </configuration>
+             </plugin>
+            <plugin>
+             <groupId>org.codehaus.mojo</groupId>
+             <artifactId>sonar-maven-plugin</artifactId>
+             <version>3.2</version>
+           </plugin>
+           <plugin>
+             <groupId>org.jacoco</groupId>
+             <artifactId>jacoco-maven-plugin</artifactId>
+             <version>0.7.7.201606060606</version>
+             <configuration>
+                  <dumpOnExit>true</dumpOnExit>
+             </configuration>
+             <executions>
+                  <execution>
+                    <id>jacoco-initialize-unit-tests</id>
+                    <goals>
+                          <goal>prepare-agent</goal>
+                    </goals>
+                    <configuration>
+                          <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
+                          <!-- <append>true</append> -->
+                    </configuration>
+                  </execution>
+             </executions>
+           </plugin>
+               </plugins>              
        </build>
        
+       
 </project>