Improve code coverage for aaf authz modules
[aaf/authz.git] / authz-service / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!--\r
3   ============LICENSE_START====================================================\r
4   * org.onap.aaf\r
5   * ===========================================================================\r
6   * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
7   * ===========================================================================\r
8   * Licensed under the Apache License, Version 2.0 (the "License");\r
9   * you may not use this file except in compliance with the License.\r
10   * You may obtain a copy of the License at\r
11   * \r
12    *      http://www.apache.org/licenses/LICENSE-2.0\r
13   * \r
14    * Unless required by applicable law or agreed to in writing, software\r
15   * distributed under the License is distributed on an "AS IS" BASIS,\r
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17   * See the License for the specific language governing permissions and\r
18   * limitations under the License.\r
19   * ============LICENSE_END====================================================\r
20   *\r
21   * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
22   *\r
23 -->\r
24 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
25         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
26         <modelVersion>4.0.0</modelVersion>\r
27         <parent>\r
28                 <groupId>org.onap.aaf.authz</groupId>\r
29                 <artifactId>parent</artifactId>\r
30                 <version>1.0.1-SNAPSHOT</version>\r
31                 <relativePath>../pom.xml</relativePath>\r
32         </parent>\r
33                 \r
34         <artifactId>authz-service</artifactId>\r
35         <name>Authz Service</name>\r
36         <description>API for Authorization and Authentication</description>\r
37                 <url>https://github.com/att/AAF</url>\r
38         <licenses>\r
39                 <license>\r
40                 <name>BSD License</name>\r
41                 <url> </url>\r
42                 </license>\r
43         </licenses>\r
44         <developers>\r
45                 <developer>\r
46                 <name>Jonathan Gathman</name>\r
47                 <email></email>\r
48         <organization>ATT</organization>\r
49         <organizationUrl></organizationUrl>\r
50                 </developer>\r
51         </developers>\r
52 \r
53         <properties>\r
54         <maven.build.timestamp.format>yyyy.MM.dd'T'hh.mm.ss'Z'</maven.build.timestamp.format>\r
55                 <maven.test.failure.ignore>true</maven.test.failure.ignore>\r
56                 <project.swmVersion>1</project.swmVersion>\r
57                         <project.innoVersion>1.0.0-SNAPSHOT</project.innoVersion>\r
58                 <project.cadiVersion>1.0.0-SNAPSHOT</project.cadiVersion>\r
59         <dockerLocation>${basedir}/target/</dockerLocation>\r
60                 <distFilesRootDirPath>opt/app/aaf/${project.artifactId}/${project.version}</distFilesRootDirPath>\r
61                         <sonar.language>java</sonar.language>\r
62                 <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>\r
63                 <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>\r
64                 <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>\r
65                 <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</sonar.jacoco.itReportPath>\r
66                 <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>\r
67                 <sonar.projectVersion>${project.version}</sonar.projectVersion>\r
68         <nexusproxy>https://nexus.onap.org</nexusproxy>\r
69                 <docker.push.registry>localhost:5000</docker.push.registry>\r
70                 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>\r
71                 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>\r
72                 <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>\r
73                 <sitePath>/content/sites/site/org/onap/aaf/authz/${project.artifactId}/${project.version}</sitePath>\r
74         <skip.docker.build>true</skip.docker.build>\r
75         <skip.docker.push>true</skip.docker.push>\r
76         <skip.staging.artifacts>false</skip.staging.artifacts>\r
77         </properties>\r
78         \r
79                 \r
80         <dependencies>\r
81         <dependency>\r
82             <groupId>org.onap.aaf.authz</groupId>\r
83             <artifactId>authz-client</artifactId>\r
84                         <version>${project.version}</version>\r
85         </dependency>\r
86                 \r
87                 <dependency>\r
88             <groupId>org.onap.aaf.authz</groupId>\r
89             <artifactId>authz-cmd</artifactId>\r
90                         <version>${project.version}</version>\r
91         </dependency>           \r
92         <dependency>\r
93             <groupId>org.onap.aaf.authz</groupId>\r
94             <artifactId>authz-core</artifactId>\r
95                         <version>${project.version}</version>\r
96             <exclusions>\r
97                           <exclusion> \r
98                                         <groupId>javax.servlet</groupId>\r
99                         <artifactId>servlet-api</artifactId>\r
100                    </exclusion>\r
101                     </exclusions> \r
102         </dependency>\r
103         \r
104         <dependency>\r
105             <groupId>org.onap.aaf.authz</groupId>\r
106             <artifactId>authz-cass</artifactId>\r
107                         <version>${project.version}</version>\r
108         </dependency>\r
109 \r
110         <dependency>\r
111             <groupId>org.onap.aaf.authz</groupId>\r
112             <artifactId>authz-defOrg</artifactId>\r
113             <version>${project.version}</version>\r
114         </dependency>\r
115 \r
116 \r
117         \r
118         <dependency > \r
119                         <groupId>org.onap.aaf.inno</groupId>\r
120                         <artifactId>env</artifactId>\r
121                         <version>${project.innoVersion}</version>\r
122                 </dependency>\r
123 \r
124 \r
125                 <dependency>\r
126                         <groupId>org.onap.aaf.cadi</groupId>\r
127                         <artifactId>cadi-core</artifactId>\r
128                         <version>${project.cadiVersion}</version>\r
129                 </dependency>\r
130 \r
131                 <dependency>\r
132                         <groupId>com.att.aft</groupId>\r
133                         <artifactId>dme2</artifactId>\r
134                 </dependency>\r
135 \r
136                 <dependency>\r
137                         <groupId>org.onap.aaf.inno</groupId>\r
138                         <artifactId>rosetta</artifactId>\r
139                         <version>${project.innoVersion}</version>\r
140                 </dependency>\r
141                 <dependency>\r
142                         <groupId>org.onap.aaf.cadi</groupId>\r
143                         <artifactId>cadi-aaf</artifactId>\r
144                         <version>${project.cadiVersion}</version>\r
145                 </dependency>   \r
146         </dependencies>\r
147 \r
148 \r
149         <build>\r
150         <finalName>authz-service</finalName>\r
151             <plugins>\r
152         \r
153                 \r
154 <plugin>\r
155         <groupId>com.spotify</groupId>\r
156         <artifactId>docker-maven-plugin</artifactId>\r
157         <version>1.0.0</version>\r
158         <configuration>\r
159           <imageName>onap/aaf/authz-service</imageName>\r
160          <!-- <dockerDirectory>${dockerLocation}</dockerDirectory> -->\r
161                   <dockerDirectory>${basedir}/src/main/resources/docker</dockerDirectory>\r
162           <imageTags>\r
163             <imageTag>latest</imageTag>\r
164             <imageTag>${project.docker.latesttagtimestamp.version}</imageTag>\r
165             <imageTag>${project.docker.latesttag.version}</imageTag>\r
166           </imageTags>\r
167           <forceTags>true</forceTags>\r
168                  <!-- <resources>\r
169             <resource>\r
170                             <targetPath>/</targetPath>\r
171                     <directory>${project.build.directory}/opt</directory>\r
172                     <filtering>true</filtering>\r
173                      <includes>\r
174                         <include>**/**</include>\r
175                             </includes>\r
176             </resource>\r
177          </resources>  -->               \r
178                    <resources>\r
179             <resource>\r
180               <targetPath>/</targetPath>\r
181               <directory>${project.build.directory}/opt</directory>\r
182               <include>${project.build.finalName}.jar</include>\r
183             </resource>\r
184             <resource>\r
185               <targetPath>/</targetPath>\r
186               <directory>${project.build.directory}</directory>\r
187               <include>**/**</include>\r
188             </resource>\r
189           </resources>\r
190                  </configuration>\r
191         <executions>\r
192        <execution>\r
193             <id>build-image</id>\r
194             <phase>package</phase>\r
195             <goals>\r
196               <goal>build</goal>\r
197             </goals>\r
198             <configuration>\r
199               <skipDockerBuild>${skip.docker.build}</skipDockerBuild>\r
200             </configuration>\r
201           </execution> \r
202 \r
203           <execution>\r
204             <id>tag-image-project-version</id>\r
205             <phase>package</phase>\r
206             <goals>\r
207               <goal>tag</goal>\r
208             </goals>\r
209             <configuration>\r
210               <image>onap/aaf/authz-service</image>\r
211               <newName>${docker.push.registry}/onap/aaf/authz-service:${project.version}</newName>\r
212               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
213             </configuration>\r
214           </execution>\r
215                   \r
216                   <execution>\r
217             <id>tag-image-latest</id>\r
218             <phase>package</phase>\r
219             <goals>\r
220               <goal>tag</goal>\r
221             </goals>\r
222             <configuration>\r
223               <image>onap/aaf/authz-service</image>\r
224               <newName>${docker.push.registry}/onap/aaf/authz-service:latest</newName>\r
225               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
226             </configuration>\r
227           </execution>\r
228           \r
229          <execution>\r
230             <id>push-image-latest</id>\r
231             <phase>deploy</phase>\r
232             <goals>\r
233               <goal>push</goal>\r
234             </goals>\r
235             <configuration>\r
236               <imageName>${docker.push.registry}/onap/aaf/authz-service:${project.version}</imageName>\r
237               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
238             </configuration>\r
239           </execution>\r
240           \r
241           <execution>\r
242             <id>push-image</id>\r
243             <phase>deploy</phase>\r
244             <goals>\r
245               <goal>push</goal>\r
246             </goals>\r
247             <configuration>\r
248               <imageName>${docker.push.registry}/onap/aaf/authz-service:latest</imageName>\r
249               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
250             </configuration>\r
251           </execution>\r
252         </executions>\r
253       </plugin>\r
254 \r
255  <plugin>\r
256                 <artifactId>maven-resources-plugin</artifactId>\r
257                 <version>2.7</version>\r
258               <executions>\r
259                     <execution>\r
260                         <id>copy-docker-file</id>\r
261                         <phase>package</phase>\r
262                         <goals>\r
263                             <goal>copy-resources</goal>\r
264                         </goals>\r
265                         <configuration>\r
266                             <outputDirectory>${dockerLocation}</outputDirectory>\r
267                             <overwrite>true</overwrite>\r
268                             <resources>\r
269                                 <resource>\r
270                                     <directory>${basedir}/src/main/resources/docker</directory>\r
271                                     <filtering>true</filtering>\r
272                                     <includes>\r
273                                         <include>**/*</include>\r
274                                     </includes>\r
275                                 </resource>\r
276                             </resources>\r
277                         </configuration>\r
278                     </execution>  \r
279       <execution>\r
280         <id>copy-resources-1</id>\r
281         <phase>validate</phase>\r
282         <goals>\r
283           <goal>copy-resources</goal>\r
284         </goals>\r
285         <configuration>\r
286          <outputDirectory>${project.build.directory}/opt/dme2reg/</outputDirectory>\r
287           <resources>\r
288             <resource>\r
289                         <directory>${project.basedir}/src/main/resources/dme2reg/</directory> \r
290                                                  <includes>\r
291                                                  <include>**/*.txt</include>\r
292                         </includes>\r
293                     </resource>\r
294           </resources>\r
295         </configuration>\r
296       </execution>\r
297       <execution>\r
298         <id>copy-resources-2</id>\r
299         <phase>validate</phase>\r
300         <goals>\r
301           <goal>copy-resources</goal>\r
302         </goals>\r
303         <configuration>\r
304           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc</outputDirectory>\r
305           <resources>\r
306             <resource>\r
307                         <directory>${project.basedir}/src/main/resources/etc</directory>\r
308                         <includes>\r
309                             <include>**/**</include>\r
310                         </includes>\r
311                     </resource>\r
312           </resources>\r
313         </configuration>\r
314       </execution>\r
315           \r
316            <execution>\r
317         <id>copy-resources-3</id>\r
318         <phase>validate</phase>\r
319         <goals>\r
320           <goal>copy-resources</goal>\r
321         </goals>\r
322         <configuration>\r
323           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
324           <resources>\r
325             <resource>\r
326                         <directory>${project.basedir}/../authz-cmd/target</directory>\r
327                         <includes>\r
328                             <include>**/*.jar</include>\r
329                         </includes>\r
330                     </resource>\r
331           </resources>\r
332         </configuration>\r
333       </execution>\r
334           <execution>\r
335         <id>copy-resources-4</id>\r
336         <phase>validate</phase>\r
337         <goals>\r
338           <goal>copy-resources</goal>\r
339         </goals>\r
340         <configuration>\r
341           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/</outputDirectory>\r
342           <resources>\r
343             <resource>\r
344                         <directory>${project.basedir}/../authz-cmd</directory>\r
345                         <includes>\r
346                             <include>**/aafcli.sh</include>\r
347                         </includes>\r
348                     </resource>\r
349           </resources>\r
350         </configuration>\r
351       </execution>\r
352                 <execution>\r
353         <id>copy-resources-5</id>\r
354         <phase>validate</phase>\r
355         <goals>\r
356           <goal>copy-resources</goal>\r
357         </goals>\r
358         <configuration>\r
359           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/</outputDirectory>\r
360           <resources>\r
361             <resource>\r
362                         <directory>${project.basedir}/src/main/config</directory>\r
363                         <includes>\r
364                             <include>**/**</include>\r
365                         </includes>\r
366                     </resource>\r
367           </resources>\r
368         </configuration>\r
369       </execution>\r
370           <execution>\r
371         <id>copy-resources-6</id>\r
372         <phase>validate</phase>\r
373         <goals>\r
374           <goal>copy-resources</goal>\r
375         </goals>\r
376         <configuration>\r
377           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/data</outputDirectory>\r
378           <resources>\r
379             <resource>\r
380                         <directory>${project.basedir}/../opt/app/aaf/data</directory>\r
381                         <includes>\r
382                             <include>**/**</include>\r
383                         </includes>\r
384                     </resource>\r
385           </resources>\r
386         </configuration>\r
387                 </execution>\r
388     </executions>\r
389   </plugin>\r
390                         <plugin>\r
391                                 <groupId>org.apache.maven.plugins</groupId>\r
392                                 <artifactId>maven-dependency-plugin</artifactId>\r
393                                 <version>2.10</version>\r
394                                 <executions>\r
395                                         <execution>\r
396                                                 <id>copy-dependencies</id>\r
397                                                 <phase>package</phase>\r
398                                                 <goals>\r
399                                                         <goal>copy-dependencies</goal>\r
400                                                 </goals>\r
401                                                 <configuration>\r
402                                                         <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
403                                                         <overWriteReleases>false</overWriteReleases>\r
404                                                         <overWriteSnapshots>false</overWriteSnapshots>\r
405                                                         <overWriteIfNewer>true</overWriteIfNewer>\r
406                                                 </configuration>\r
407                                         </execution>\r
408                                 </executions>\r
409                         </plugin>\r
410                                 \r
411                     <plugin>\r
412                         <groupId>org.codehaus.mojo</groupId>\r
413                         <artifactId>exec-maven-plugin</artifactId>\r
414                         <version>1.5.0</version>\r
415                         <configuration>\r
416                             <executable>java</executable>\r
417                             <arguments>\r
418                                 <argument>-DAFT_LATITUDE=33</argument>\r
419                                 <argument>-DAFT_LONGITUDE=-84</argument>\r
420                                 <argument>-DAFT_ENVIRONMENT=AFTUAT</argument>\r
421         \r
422                                 <argument>-XX:NewRatio=3</argument>\r
423                                 <argument>-XX:+PrintGCTimeStamps</argument>\r
424                                 <argument>-XX:+PrintGCDetails</argument>\r
425                                 <argument>-Xloggc:gc.log</argument>\r
426                                 <argument>-classpath</argument>\r
427         \r
428                                 <classpath>\r
429                                 \r
430                                 </classpath>\r
431                                 <argument>org.onap.aaf.authz.service.AuthAPI</argument>\r
432         \r
433                            <argument>service=org.onap.aaf.authz.AuthorizationService/version=2.0/envContext=DEV/routeOffer=Dev</argument>\r
434                             </arguments>\r
435                         </configuration>\r
436                     </plugin>\r
437         \r
438                     <plugin>\r
439                                 <groupId>org.apache.maven.plugins</groupId>\r
440                                 <artifactId>maven-jar-plugin</artifactId>\r
441                                         <configuration>\r
442                                                 <excludes>\r
443                                 <exclude>*.properties</exclude>\r
444                                 </excludes>\r
445                                         </configuration>\r
446                                         <version>2.3.1</version>\r
447                                 </plugin>\r
448  \r
449 \r
450                 <plugin>\r
451                         <groupId>org.apache.maven.plugins</groupId>\r
452                         <artifactId>maven-javadoc-plugin</artifactId>\r
453                         <version>2.10.4</version>\r
454                         <configuration>\r
455                         <failOnError>false</failOnError>\r
456                         </configuration>\r
457                         <executions>\r
458                                 <execution>\r
459                                         <id>attach-javadocs</id>\r
460                                         <goals>\r
461                                                 <goal>jar</goal>\r
462                                         </goals>\r
463                                 </execution>\r
464                         </executions>\r
465                 </plugin> \r
466            \r
467            \r
468                <plugin>\r
469                       <groupId>org.apache.maven.plugins</groupId>\r
470                       <artifactId>maven-source-plugin</artifactId>\r
471                       <version>2.2.1</version>\r
472                       <executions>\r
473                         <execution>\r
474                           <id>attach-sources</id>\r
475                           <goals>\r
476                             <goal>jar-no-fork</goal>\r
477                           </goals>\r
478                         </execution>\r
479                       </executions>\r
480                     </plugin>\r
481                         \r
482 <plugin>\r
483                                 <groupId>org.sonatype.plugins</groupId>\r
484                                 <artifactId>nexus-staging-maven-plugin</artifactId>\r
485                                 <version>1.6.7</version>\r
486                                 <extensions>true</extensions>\r
487                                 <configuration>\r
488                                         <nexusUrl>${nexusproxy}</nexusUrl>\r
489                                         <stagingProfileId>176c31dfe190a</stagingProfileId>\r
490                                         <serverId>ecomp-staging</serverId>\r
491                                 </configuration>\r
492                         </plugin>               \r
493                         <plugin>\r
494           <groupId>org.jacoco</groupId>\r
495           <artifactId>jacoco-maven-plugin</artifactId>\r
496           <version>${jacoco.version}</version>\r
497           <configuration>\r
498             <!-- Note: This exclusion list should match <sonar.exclusions>\r
499          property above -->\r
500             <excludes>\r
501               <exclude>**/gen/**</exclude>\r
502               <exclude>**/generated-sources/**</exclude>\r
503               <exclude>**/yang-gen/**</exclude>\r
504               <exclude>**/pax/**</exclude>\r
505             </excludes>\r
506           </configuration>\r
507           <executions>\r
508             <!--\r
509         Prepares the property pointing to the JaCoCo runtime agent which\r
510         is passed as VM argument when Maven the Surefire plugin is executed.\r
511         -->\r
512             <execution>\r
513               <id>pre-unit-test</id>\r
514               <goals>\r
515                 <goal>prepare-agent</goal>\r
516               </goals>\r
517               <configuration>\r
518                 <!-- Sets the path to the file which contains the execution data. -->\r
519                 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>\r
520                 <!--\r
521             Sets the name of the property containing the settings\r
522             for JaCoCo runtime agent.\r
523         -->\r
524                 <propertyName>surefireArgLine</propertyName>\r
525               </configuration>\r
526             </execution>\r
527             <!--\r
528         Ensures that the code coverage report for unit tests is created after\r
529         unit tests have been run.\r
530         -->\r
531             <execution>\r
532               <id>post-unit-test</id>\r
533               <phase>test</phase>\r
534               <goals>\r
535                 <goal>report</goal>\r
536               </goals>\r
537               <configuration>\r
538                 <!-- Sets the path to the file which contains the execution data. -->\r
539                 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>\r
540                 <!-- Sets the output directory for the code coverage report. -->\r
541                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>\r
542               </configuration>\r
543             </execution>\r
544             <execution>\r
545               <id>pre-integration-test</id>\r
546               <phase>pre-integration-test</phase>\r
547               <goals>\r
548                 <goal>prepare-agent</goal>\r
549               </goals>\r
550               <configuration>\r
551                 <!-- Sets the path to the file which contains the execution data. -->\r
552                 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>\r
553                 <!--\r
554             Sets the name of the property containing the settings\r
555             for JaCoCo runtime agent.\r
556         -->\r
557                 <propertyName>failsafeArgLine</propertyName>\r
558               </configuration>\r
559             </execution>\r
560             <!--\r
561         Ensures that the code coverage report for integration tests after\r
562         integration tests have been run.\r
563         -->\r
564             <execution>\r
565               <id>post-integration-test</id>\r
566               <phase>post-integration-test</phase>\r
567               <goals>\r
568                 <goal>report</goal>\r
569               </goals>\r
570               <configuration>\r
571                 <!-- Sets the path to the file which contains the execution data. -->\r
572                 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>\r
573                 <!-- Sets the output directory for the code coverage report. -->\r
574                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>\r
575               </configuration>\r
576             </execution>\r
577           </executions>\r
578         </plugin>                    \r
579 \r
580                 \r
581                         </plugins>\r
582 \r
583         </build>\r
584 \r
585 \r
586                 <distributionManagement>\r
587                 <repository>\r
588                         <id>ecomp-releases</id>\r
589                         <name>AAF Release Repository</name>\r
590                         <url>${nexusproxy}${releaseNexusPath}</url>\r
591                 </repository>\r
592                 <snapshotRepository>\r
593                         <id>ecomp-snapshots</id>\r
594                         <name>AAF Snapshot Repository</name>\r
595                         <url>${nexusproxy}${snapshotNexusPath}</url>\r
596                 </snapshotRepository>\r
597                 <site>\r
598                         <id>ecomp-site</id>\r
599                         <url>dav:${nexusproxy}${sitePath}</url>\r
600                 </site>\r
601         </distributionManagement>\r
602  <profiles>\r
603     <profile>\r
604       <id>docker</id>\r
605       <properties>\r
606         <skip.staging.artifacts>true</skip.staging.artifacts>\r
607         <skip.docker.build>false</skip.docker.build>\r
608         <skip.docker.tag>false</skip.docker.tag>\r
609         <skip.docker.push>false</skip.docker.push>\r
610       </properties>\r
611     </profile>\r
612   </profiles>\r
613 </project>\r