Modify Authz-service pom file to releaser docker
[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>true</sonar.jacoco.reportMissing.force.zero>\r
67                 <sonar.projectVersion>${project.version}</sonar.projectVersion>\r
68         <nexusproxy>https://nexus.onap.org</nexusproxy>\r
69                 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>\r
70                 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>\r
71                 <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>\r
72                 <sitePath>/content/sites/site/org/onap/aaf/authz/${project.artifactId}/${project.version}</sitePath>\r
73                 \r
74         <docker.push.registry>localhost:5000</docker.push.registry>\r
75         <skip.docker.build>true</skip.docker.build>\r
76         <skip.docker.push>true</skip.docker.push>\r
77         <skip.staging.artifacts>false</skip.staging.artifacts>\r
78         </properties>\r
79         \r
80                 \r
81         <dependencies>\r
82         <dependency>\r
83             <groupId>org.onap.aaf.authz</groupId>\r
84             <artifactId>authz-client</artifactId>\r
85                         <version>${project.version}</version>\r
86         </dependency>\r
87                 \r
88                 <dependency>\r
89             <groupId>org.onap.aaf.authz</groupId>\r
90             <artifactId>authz-cmd</artifactId>\r
91                         <version>${project.version}</version>\r
92         </dependency>           \r
93         <dependency>\r
94             <groupId>org.onap.aaf.authz</groupId>\r
95             <artifactId>authz-core</artifactId>\r
96                         <version>${project.version}</version>\r
97             <exclusions>\r
98                           <exclusion> \r
99                                         <groupId>javax.servlet</groupId>\r
100                         <artifactId>servlet-api</artifactId>\r
101                    </exclusion>\r
102                     </exclusions> \r
103         </dependency>\r
104         \r
105         <dependency>\r
106             <groupId>org.onap.aaf.authz</groupId>\r
107             <artifactId>authz-cass</artifactId>\r
108                         <version>${project.version}</version>\r
109         </dependency>\r
110 \r
111         <dependency>\r
112             <groupId>org.onap.aaf.authz</groupId>\r
113             <artifactId>authz-defOrg</artifactId>\r
114             <version>${project.version}</version>\r
115         </dependency>\r
116 \r
117 \r
118         \r
119         <dependency > \r
120                         <groupId>org.onap.aaf.inno</groupId>\r
121                         <artifactId>env</artifactId>\r
122                         <version>${project.innoVersion}</version>\r
123                 </dependency>\r
124 \r
125 \r
126                 <dependency>\r
127                         <groupId>org.onap.aaf.cadi</groupId>\r
128                         <artifactId>cadi-core</artifactId>\r
129                         <version>${project.cadiVersion}</version>\r
130                 </dependency>\r
131 \r
132                 <dependency>\r
133                         <groupId>com.att.aft</groupId>\r
134                         <artifactId>dme2</artifactId>\r
135                 </dependency>\r
136 \r
137                 <dependency>\r
138                         <groupId>org.onap.aaf.inno</groupId>\r
139                         <artifactId>rosetta</artifactId>\r
140                         <version>${project.innoVersion}</version>\r
141                 </dependency>\r
142                 <dependency>\r
143                         <groupId>org.onap.aaf.cadi</groupId>\r
144                         <artifactId>cadi-aaf</artifactId>\r
145                         <version>${project.cadiVersion}</version>\r
146                 </dependency>   \r
147         </dependencies>\r
148 \r
149 \r
150         <build>\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           <serverId>docker-hub</serverId>\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>/${basedir}/target/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         </configuration>\r
179         <executions>\r
180           <execution>\r
181             <id>build-image</id>\r
182             <phase>package</phase>\r
183             <goals>\r
184               <goal>build</goal>\r
185             </goals>\r
186             <configuration>\r
187               <skipDockerBuild>${skip.docker.build}</skipDockerBuild>\r
188             </configuration>\r
189           </execution>\r
190 \r
191           <execution>\r
192             <id>tag-image-latest-timestamp</id>\r
193             <phase>package</phase>\r
194             <goals>\r
195               <goal>tag</goal>\r
196             </goals>\r
197             <configuration>\r
198               <image>onap/aaf/authz-service</image>\r
199               <newName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttagtimestamp.version}</newName>\r
200               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
201             </configuration>\r
202           </execution>\r
203           <execution>\r
204             <id>push-image-latest-timestamp</id>\r
205             <phase>deploy</phase>\r
206             <goals>\r
207               <goal>push</goal>\r
208             </goals>\r
209             <configuration>\r
210               <imageName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttagtimestamp.version}</imageName>\r
211               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
212             </configuration>\r
213           </execution>\r
214           <execution>\r
215             <id>tag-image-latest</id>\r
216             <phase>package</phase>\r
217             <goals>\r
218               <goal>tag</goal>\r
219             </goals>\r
220             <configuration>\r
221               <image>onap/aaf/authz-service</image>\r
222               <newName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttag.version}</newName>\r
223               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
224             </configuration>\r
225           </execution>\r
226           <execution>\r
227             <id>push-image-latest</id>\r
228             <phase>deploy</phase>\r
229             <goals>\r
230               <goal>push</goal>\r
231             </goals>\r
232             <configuration>\r
233               <imageName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttag.version}</imageName>\r
234               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
235             </configuration>\r
236           </execution>\r
237           <execution>\r
238             <id>tag-image</id>\r
239             <phase>package</phase>\r
240             <goals>\r
241               <goal>tag</goal>\r
242             </goals>\r
243             <configuration>\r
244               <image>onap/aaf/authz-service</image>\r
245               <newName>${docker.push.registry}/onap/aaf/authz-service:latest</newName>\r
246               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
247             </configuration>\r
248           </execution>\r
249           <execution>\r
250             <id>push-image</id>\r
251             <phase>deploy</phase>\r
252             <goals>\r
253               <goal>push</goal>\r
254             </goals>\r
255             <configuration>\r
256               <imageName>${docker.push.registry}/onap/aaf/authz-service:latest</imageName>\r
257               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
258             </configuration>\r
259           </execution>\r
260         </executions>\r
261       </plugin>\r
262 \r
263                         <plugin>\r
264                 <artifactId>maven-resources-plugin</artifactId>\r
265                 <version>2.7</version>\r
266               <executions>\r
267                       <execution>\r
268                         <id>copy-docker-file</id>\r
269                         <phase>package</phase>\r
270                         <goals>\r
271                             <goal>copy-resources</goal>\r
272                         </goals>\r
273                         <configuration>\r
274                             <outputDirectory>${dockerLocation}</outputDirectory>\r
275                             <overwrite>true</overwrite>\r
276                             <resources>\r
277                                 <resource>\r
278                                     <directory>${basedir}/src/main/resources/docker</directory>\r
279                                     <filtering>true</filtering>\r
280                                     <includes>\r
281                                         <include>**/*</include>\r
282                                     </includes>\r
283                                 </resource>\r
284                             </resources>\r
285                         </configuration>\r
286                     </execution>\r
287       <execution>\r
288         <id>copy-resources-1</id>\r
289         <phase>validate</phase>\r
290         <goals>\r
291           <goal>copy-resources</goal>\r
292         </goals>\r
293         <configuration>\r
294          <outputDirectory>${project.build.directory}/opt/dme2reg/</outputDirectory>\r
295           <resources>\r
296             <resource>\r
297                         <directory>${project.basedir}/src/main/resources/dme2reg/</directory> \r
298                                                  <includes>\r
299                                                  <include>**/*.txt</include>\r
300                         </includes>\r
301                     </resource>\r
302           </resources>\r
303         </configuration>\r
304       </execution>\r
305       <execution>\r
306         <id>copy-resources-2</id>\r
307         <phase>validate</phase>\r
308         <goals>\r
309           <goal>copy-resources</goal>\r
310         </goals>\r
311         <configuration>\r
312           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc</outputDirectory>\r
313           <resources>\r
314             <resource>\r
315                         <directory>${project.basedir}/src/main/resources/etc</directory>\r
316                         <includes>\r
317                             <include>**/**</include>\r
318                         </includes>\r
319                     </resource>\r
320           </resources>\r
321         </configuration>\r
322       </execution>\r
323           \r
324            <execution>\r
325         <id>copy-resources-3</id>\r
326         <phase>validate</phase>\r
327         <goals>\r
328           <goal>copy-resources</goal>\r
329         </goals>\r
330         <configuration>\r
331           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
332           <resources>\r
333             <resource>\r
334                         <directory>${project.basedir}/../authz-cmd/target</directory>\r
335                         <includes>\r
336                             <include>**/*.jar</include>\r
337                         </includes>\r
338                     </resource>\r
339           </resources>\r
340         </configuration>\r
341       </execution>\r
342           <execution>\r
343         <id>copy-resources-4</id>\r
344         <phase>validate</phase>\r
345         <goals>\r
346           <goal>copy-resources</goal>\r
347         </goals>\r
348         <configuration>\r
349           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/</outputDirectory>\r
350           <resources>\r
351             <resource>\r
352                         <directory>${project.basedir}/../authz-cmd</directory>\r
353                         <includes>\r
354                             <include>**/aafcli.sh</include>\r
355                         </includes>\r
356                     </resource>\r
357           </resources>\r
358         </configuration>\r
359       </execution>\r
360                 <execution>\r
361         <id>copy-resources-5</id>\r
362         <phase>validate</phase>\r
363         <goals>\r
364           <goal>copy-resources</goal>\r
365         </goals>\r
366         <configuration>\r
367           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/</outputDirectory>\r
368           <resources>\r
369             <resource>\r
370                         <directory>${project.basedir}/src/main/config</directory>\r
371                         <includes>\r
372                             <include>**/**</include>\r
373                         </includes>\r
374                     </resource>\r
375           </resources>\r
376         </configuration>\r
377       </execution>\r
378           <execution>\r
379         <id>copy-resources-6</id>\r
380         <phase>validate</phase>\r
381         <goals>\r
382           <goal>copy-resources</goal>\r
383         </goals>\r
384         <configuration>\r
385           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/data</outputDirectory>\r
386           <resources>\r
387             <resource>\r
388                         <directory>${project.basedir}/../opt/app/aaf/data</directory>\r
389                         <includes>\r
390                             <include>**/**</include>\r
391                         </includes>\r
392                     </resource>\r
393           </resources>\r
394         </configuration>\r
395                 </execution>\r
396     </executions>\r
397   </plugin>\r
398                         <plugin>\r
399                                 <groupId>org.apache.maven.plugins</groupId>\r
400                                 <artifactId>maven-dependency-plugin</artifactId>\r
401                                 <version>2.10</version>\r
402                                 <executions>\r
403                                         <execution>\r
404                                                 <id>copy-dependencies</id>\r
405                                                 <phase>package</phase>\r
406                                                 <goals>\r
407                                                         <goal>copy-dependencies</goal>\r
408                                                 </goals>\r
409                                                 <configuration>\r
410                                                         <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
411                                                         <overWriteReleases>false</overWriteReleases>\r
412                                                         <overWriteSnapshots>false</overWriteSnapshots>\r
413                                                         <overWriteIfNewer>true</overWriteIfNewer>\r
414                                                 </configuration>\r
415                                         </execution>\r
416                                 </executions>\r
417                         </plugin>\r
418                                 \r
419                     <plugin>\r
420                         <groupId>org.codehaus.mojo</groupId>\r
421                         <artifactId>exec-maven-plugin</artifactId>\r
422                         <version>1.5.0</version>\r
423                         <configuration>\r
424                             <executable>java</executable>\r
425                             <arguments>\r
426                                 <argument>-DAFT_LATITUDE=33</argument>\r
427                                 <argument>-DAFT_LONGITUDE=-84</argument>\r
428                                 <argument>-DAFT_ENVIRONMENT=AFTUAT</argument>\r
429         \r
430                                 <argument>-XX:NewRatio=3</argument>\r
431                                 <argument>-XX:+PrintGCTimeStamps</argument>\r
432                                 <argument>-XX:+PrintGCDetails</argument>\r
433                                 <argument>-Xloggc:gc.log</argument>\r
434                                 <argument>-classpath</argument>\r
435         \r
436                                 <classpath>\r
437                                 \r
438                                 </classpath>\r
439                                 <argument>org.onap.aaf.authz.service.AuthAPI</argument>\r
440         \r
441                            <argument>service=org.onap.aaf.authz.AuthorizationService/version=2.0/envContext=DEV/routeOffer=Dev</argument>\r
442                             </arguments>\r
443                         </configuration>\r
444                     </plugin>\r
445         \r
446                     <plugin>\r
447                                 <groupId>org.apache.maven.plugins</groupId>\r
448                                 <artifactId>maven-jar-plugin</artifactId>\r
449                                         <configuration>\r
450                                                 <excludes>\r
451                                 <exclude>*.properties</exclude>\r
452                                 </excludes>\r
453                                         </configuration>\r
454                                         <version>2.3.1</version>\r
455                                 </plugin>\r
456  \r
457 \r
458                 <plugin>\r
459                         <groupId>org.apache.maven.plugins</groupId>\r
460                         <artifactId>maven-javadoc-plugin</artifactId>\r
461                         <version>2.10.4</version>\r
462                         <configuration>\r
463                         <failOnError>false</failOnError>\r
464                         </configuration>\r
465                         <executions>\r
466                                 <execution>\r
467                                         <id>attach-javadocs</id>\r
468                                         <goals>\r
469                                                 <goal>jar</goal>\r
470                                         </goals>\r
471                                 </execution>\r
472                         </executions>\r
473                 </plugin> \r
474            \r
475            \r
476                <plugin>\r
477                       <groupId>org.apache.maven.plugins</groupId>\r
478                       <artifactId>maven-source-plugin</artifactId>\r
479                       <version>2.2.1</version>\r
480                       <executions>\r
481                         <execution>\r
482                           <id>attach-sources</id>\r
483                           <goals>\r
484                             <goal>jar-no-fork</goal>\r
485                           </goals>\r
486                         </execution>\r
487                       </executions>\r
488                     </plugin>\r
489                         \r
490 <plugin>\r
491                                 <groupId>org.sonatype.plugins</groupId>\r
492                                 <artifactId>nexus-staging-maven-plugin</artifactId>\r
493                                 <version>1.6.7</version>\r
494                                 <extensions>true</extensions>\r
495                                 <configuration>\r
496                                         <nexusUrl>${nexusproxy}</nexusUrl>\r
497                                         <stagingProfileId>176c31dfe190a</stagingProfileId>\r
498                                         <serverId>ecomp-staging</serverId>\r
499                                 </configuration>\r
500                         </plugin>               \r
501                         <plugin>\r
502                                 <groupId>org.jacoco</groupId>\r
503                                 <artifactId>jacoco-maven-plugin</artifactId>\r
504                                 <version>0.7.7.201606060606</version>\r
505                                 <configuration>\r
506                                         <dumpOnExit>true</dumpOnExit>\r
507                                         <includes>\r
508                                                 <include>org.onap.aaf.*</include>\r
509                                         </includes>\r
510                                 </configuration>\r
511                                 <executions>\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                                                         <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>\r
519                                                         <!-- <append>true</append> -->\r
520                                                 </configuration>\r
521                                         </execution>\r
522                                         <execution>\r
523                                                 <id>pre-integration-test</id>\r
524                                                 <phase>pre-integration-test</phase>\r
525                                                 <goals>\r
526                                                         <goal>prepare-agent</goal>\r
527                                                 </goals>\r
528                                                 <configuration>\r
529                                                         <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>\r
530                                                         <!-- <append>true</append> -->\r
531                                                 </configuration>\r
532                                         </execution>\r
533                                         <execution>\r
534                         <goals>\r
535                             <goal>merge</goal>\r
536                         </goals>\r
537                         <phase>post-integration-test</phase>\r
538                         <configuration>\r
539                             <fileSets>\r
540                                 <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">\r
541                                     <directory>${project.build.directory}/coverage-reports</directory>\r
542                                     <includes>\r
543                                         <include>*.exec</include>\r
544                                     </includes>\r
545                                 </fileSet>\r
546                             </fileSets>\r
547                             <destFile>${project.build.directory}/jacoco-dev.exec</destFile>\r
548                         </configuration>\r
549                     </execution>\r
550                                 </executions>\r
551                         </plugin>\r
552                 \r
553                         </plugins>\r
554 \r
555         </build>\r
556 \r
557 \r
558                 <distributionManagement>\r
559                 <repository>\r
560                         <id>ecomp-releases</id>\r
561                         <name>AAF Release Repository</name>\r
562                         <url>${nexusproxy}${releaseNexusPath}</url>\r
563                 </repository>\r
564                 <snapshotRepository>\r
565                         <id>ecomp-snapshots</id>\r
566                         <name>AAF Snapshot Repository</name>\r
567                         <url>${nexusproxy}${snapshotNexusPath}</url>\r
568                 </snapshotRepository>\r
569                 <site>\r
570                         <id>ecomp-site</id>\r
571                         <url>dav:${nexusproxy}${sitePath}</url>\r
572                 </site>\r
573         </distributionManagement>\r
574  <profiles>\r
575     <profile>\r
576       <id>docker</id>\r
577       <properties>\r
578         <skip.staging.artifacts>true</skip.staging.artifacts>\r
579         <skip.docker.build>false</skip.docker.build>\r
580         <skip.docker.tag>false</skip.docker.tag>\r
581         <skip.docker.push>false</skip.docker.push>\r
582       </properties>\r
583     </profile>\r
584   </profiles>\r
585 </project>\r