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               <buildArgs>\r
189                 <http_proxy>${env.HTTP_PROXY}</http_proxy>\r
190                 <https_proxy>${env.HTTPS_PROXY}</https_proxy>\r
191               </buildArgs>\r
192             </configuration>\r
193           </execution>\r
194 \r
195           <execution>\r
196             <id>tag-image-latest-timestamp</id>\r
197             <phase>package</phase>\r
198             <goals>\r
199               <goal>tag</goal>\r
200             </goals>\r
201             <configuration>\r
202               <image>onap/aaf/authz-service</image>\r
203               <newName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttagtimestamp.version}</newName>\r
204               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
205             </configuration>\r
206           </execution>\r
207           <execution>\r
208             <id>push-image-latest-timestamp</id>\r
209             <phase>deploy</phase>\r
210             <goals>\r
211               <goal>push</goal>\r
212             </goals>\r
213             <configuration>\r
214               <imageName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttagtimestamp.version}</imageName>\r
215               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
216             </configuration>\r
217           </execution>\r
218           <execution>\r
219             <id>tag-image-latest</id>\r
220             <phase>package</phase>\r
221             <goals>\r
222               <goal>tag</goal>\r
223             </goals>\r
224             <configuration>\r
225               <image>onap/aaf/authz-service</image>\r
226               <newName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttag.version}</newName>\r
227               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
228             </configuration>\r
229           </execution>\r
230           <execution>\r
231             <id>push-image-latest</id>\r
232             <phase>deploy</phase>\r
233             <goals>\r
234               <goal>push</goal>\r
235             </goals>\r
236             <configuration>\r
237               <imageName>${docker.push.registry}/onap/aaf/authz-service:${project.docker.latesttag.version}</imageName>\r
238               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
239             </configuration>\r
240           </execution>\r
241           <execution>\r
242             <id>tag-image</id>\r
243             <phase>package</phase>\r
244             <goals>\r
245               <goal>tag</goal>\r
246             </goals>\r
247             <configuration>\r
248               <image>onap/aaf/authz-service</image>\r
249               <newName>${docker.push.registry}/onap/aaf/authz-service:latest</newName>\r
250               <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
251             </configuration>\r
252           </execution>\r
253           <execution>\r
254             <id>push-image</id>\r
255             <phase>deploy</phase>\r
256             <goals>\r
257               <goal>push</goal>\r
258             </goals>\r
259             <configuration>\r
260               <imageName>${docker.push.registry}/onap/aaf/authz-service:latest</imageName>\r
261               <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
262             </configuration>\r
263           </execution>\r
264         </executions>\r
265       </plugin>\r
266 \r
267 \r
268 \r
269 \r
270                 \r
271                         \r
272                         <plugin>\r
273                 <artifactId>maven-resources-plugin</artifactId>\r
274                 <version>2.7</version>\r
275               <executions>\r
276                       <execution>\r
277                         <id>copy-docker-file</id>\r
278                         <phase>package</phase>\r
279                         <goals>\r
280                             <goal>copy-resources</goal>\r
281                         </goals>\r
282                         <configuration>\r
283                             <outputDirectory>${dockerLocation}</outputDirectory>\r
284                             <overwrite>true</overwrite>\r
285                             <resources>\r
286                                 <resource>\r
287                                     <directory>${basedir}/src/main/resources/docker</directory>\r
288                                     <filtering>true</filtering>\r
289                                     <includes>\r
290                                         <include>**/*</include>\r
291                                     </includes>\r
292                                 </resource>\r
293                             </resources>\r
294                         </configuration>\r
295                     </execution>\r
296       <execution>\r
297         <id>copy-resources-1</id>\r
298         <phase>validate</phase>\r
299         <goals>\r
300           <goal>copy-resources</goal>\r
301         </goals>\r
302         <configuration>\r
303          <outputDirectory>${project.build.directory}/opt/dme2reg/</outputDirectory>\r
304           <resources>\r
305             <resource>\r
306                         <directory>${project.basedir}/src/main/resources/dme2reg/</directory> \r
307                                                  <includes>\r
308                                                  <include>**/*.txt</include>\r
309                         </includes>\r
310                     </resource>\r
311           </resources>\r
312         </configuration>\r
313       </execution>\r
314       <execution>\r
315         <id>copy-resources-2</id>\r
316         <phase>validate</phase>\r
317         <goals>\r
318           <goal>copy-resources</goal>\r
319         </goals>\r
320         <configuration>\r
321           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc</outputDirectory>\r
322           <resources>\r
323             <resource>\r
324                         <directory>${project.basedir}/src/main/resources/etc</directory>\r
325                         <includes>\r
326                             <include>**/**</include>\r
327                         </includes>\r
328                     </resource>\r
329           </resources>\r
330         </configuration>\r
331       </execution>\r
332           \r
333            <execution>\r
334         <id>copy-resources-3</id>\r
335         <phase>validate</phase>\r
336         <goals>\r
337           <goal>copy-resources</goal>\r
338         </goals>\r
339         <configuration>\r
340           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
341           <resources>\r
342             <resource>\r
343                         <directory>${project.basedir}/../authz-cmd/target</directory>\r
344                         <includes>\r
345                             <include>**/*.jar</include>\r
346                         </includes>\r
347                     </resource>\r
348           </resources>\r
349         </configuration>\r
350       </execution>\r
351           <execution>\r
352         <id>copy-resources-4</id>\r
353         <phase>validate</phase>\r
354         <goals>\r
355           <goal>copy-resources</goal>\r
356         </goals>\r
357         <configuration>\r
358           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/</outputDirectory>\r
359           <resources>\r
360             <resource>\r
361                         <directory>${project.basedir}/../authz-cmd</directory>\r
362                         <includes>\r
363                             <include>**/aafcli.sh</include>\r
364                         </includes>\r
365                     </resource>\r
366           </resources>\r
367         </configuration>\r
368       </execution>\r
369                 <execution>\r
370         <id>copy-resources-5</id>\r
371         <phase>validate</phase>\r
372         <goals>\r
373           <goal>copy-resources</goal>\r
374         </goals>\r
375         <configuration>\r
376           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/</outputDirectory>\r
377           <resources>\r
378             <resource>\r
379                         <directory>${project.basedir}/src/main/config</directory>\r
380                         <includes>\r
381                             <include>**/**</include>\r
382                         </includes>\r
383                     </resource>\r
384           </resources>\r
385         </configuration>\r
386       </execution>\r
387           <execution>\r
388         <id>copy-resources-6</id>\r
389         <phase>validate</phase>\r
390         <goals>\r
391           <goal>copy-resources</goal>\r
392         </goals>\r
393         <configuration>\r
394           <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/etc/data</outputDirectory>\r
395           <resources>\r
396             <resource>\r
397                         <directory>${project.basedir}/../opt/app/aaf/data</directory>\r
398                         <includes>\r
399                             <include>**/**</include>\r
400                         </includes>\r
401                     </resource>\r
402           </resources>\r
403         </configuration>\r
404                 </execution>\r
405     </executions>\r
406   </plugin>\r
407                         <plugin>\r
408                                 <groupId>org.apache.maven.plugins</groupId>\r
409                                 <artifactId>maven-dependency-plugin</artifactId>\r
410                                 <version>2.10</version>\r
411                                 <executions>\r
412                                         <execution>\r
413                                                 <id>copy-dependencies</id>\r
414                                                 <phase>package</phase>\r
415                                                 <goals>\r
416                                                         <goal>copy-dependencies</goal>\r
417                                                 </goals>\r
418                                                 <configuration>\r
419                                                         <outputDirectory>${project.build.directory}/opt/app/aaf/authz-service/lib</outputDirectory>\r
420                                                         <overWriteReleases>false</overWriteReleases>\r
421                                                         <overWriteSnapshots>false</overWriteSnapshots>\r
422                                                         <overWriteIfNewer>true</overWriteIfNewer>\r
423                                                 </configuration>\r
424                                         </execution>\r
425                                 </executions>\r
426                         </plugin>\r
427                                 \r
428                     <plugin>\r
429                         <groupId>org.codehaus.mojo</groupId>\r
430                         <artifactId>exec-maven-plugin</artifactId>\r
431                         <version>1.5.0</version>\r
432                         <configuration>\r
433                             <executable>java</executable>\r
434                             <arguments>\r
435                                 <argument>-DAFT_LATITUDE=33</argument>\r
436                                 <argument>-DAFT_LONGITUDE=-84</argument>\r
437                                 <argument>-DAFT_ENVIRONMENT=AFTUAT</argument>\r
438         \r
439                                 <argument>-XX:NewRatio=3</argument>\r
440                                 <argument>-XX:+PrintGCTimeStamps</argument>\r
441                                 <argument>-XX:+PrintGCDetails</argument>\r
442                                 <argument>-Xloggc:gc.log</argument>\r
443                                 <argument>-classpath</argument>\r
444         \r
445                                 <classpath>\r
446                                 \r
447                                 </classpath>\r
448                                 <argument>org.onap.aaf.authz.service.AuthAPI</argument>\r
449         \r
450                            <argument>service=org.onap.aaf.authz.AuthorizationService/version=2.0/envContext=DEV/routeOffer=Dev</argument>\r
451                             </arguments>\r
452                         </configuration>\r
453                     </plugin>\r
454         \r
455                     <plugin>\r
456                                 <groupId>org.apache.maven.plugins</groupId>\r
457                                 <artifactId>maven-jar-plugin</artifactId>\r
458                                         <configuration>\r
459                                                 <excludes>\r
460                                 <exclude>*.properties</exclude>\r
461                                 </excludes>\r
462                                         </configuration>\r
463                                         <version>2.3.1</version>\r
464                                 </plugin>\r
465  \r
466 \r
467                 <plugin>\r
468                         <groupId>org.apache.maven.plugins</groupId>\r
469                         <artifactId>maven-javadoc-plugin</artifactId>\r
470                         <version>2.10.4</version>\r
471                         <configuration>\r
472                         <failOnError>false</failOnError>\r
473                         </configuration>\r
474                         <executions>\r
475                                 <execution>\r
476                                         <id>attach-javadocs</id>\r
477                                         <goals>\r
478                                                 <goal>jar</goal>\r
479                                         </goals>\r
480                                 </execution>\r
481                         </executions>\r
482                 </plugin> \r
483            \r
484            \r
485                <plugin>\r
486                       <groupId>org.apache.maven.plugins</groupId>\r
487                       <artifactId>maven-source-plugin</artifactId>\r
488                       <version>2.2.1</version>\r
489                       <executions>\r
490                         <execution>\r
491                           <id>attach-sources</id>\r
492                           <goals>\r
493                             <goal>jar-no-fork</goal>\r
494                           </goals>\r
495                         </execution>\r
496                       </executions>\r
497                     </plugin>\r
498                         \r
499 <plugin>\r
500                                 <groupId>org.sonatype.plugins</groupId>\r
501                                 <artifactId>nexus-staging-maven-plugin</artifactId>\r
502                                 <version>1.6.7</version>\r
503                                 <extensions>true</extensions>\r
504                                 <configuration>\r
505                                         <nexusUrl>${nexusproxy}</nexusUrl>\r
506                                         <stagingProfileId>176c31dfe190a</stagingProfileId>\r
507                                         <serverId>ecomp-staging</serverId>\r
508                                 </configuration>\r
509                         </plugin>               \r
510                         <plugin>\r
511                                 <groupId>org.jacoco</groupId>\r
512                                 <artifactId>jacoco-maven-plugin</artifactId>\r
513                                 <version>0.7.7.201606060606</version>\r
514                                 <configuration>\r
515                                         <dumpOnExit>true</dumpOnExit>\r
516                                         <includes>\r
517                                                 <include>org.onap.aaf.*</include>\r
518                                         </includes>\r
519                                 </configuration>\r
520                                 <executions>\r
521                                         <execution>\r
522                                                 <id>pre-unit-test</id>\r
523                                                 <goals>\r
524                                                         <goal>prepare-agent</goal>\r
525                                                 </goals>\r
526                                                 <configuration>\r
527                                                         <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>\r
528                                                         <!-- <append>true</append> -->\r
529                                                 </configuration>\r
530                                         </execution>\r
531                                         <execution>\r
532                                                 <id>pre-integration-test</id>\r
533                                                 <phase>pre-integration-test</phase>\r
534                                                 <goals>\r
535                                                         <goal>prepare-agent</goal>\r
536                                                 </goals>\r
537                                                 <configuration>\r
538                                                         <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>\r
539                                                         <!-- <append>true</append> -->\r
540                                                 </configuration>\r
541                                         </execution>\r
542                                         <execution>\r
543                         <goals>\r
544                             <goal>merge</goal>\r
545                         </goals>\r
546                         <phase>post-integration-test</phase>\r
547                         <configuration>\r
548                             <fileSets>\r
549                                 <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">\r
550                                     <directory>${project.build.directory}/coverage-reports</directory>\r
551                                     <includes>\r
552                                         <include>*.exec</include>\r
553                                     </includes>\r
554                                 </fileSet>\r
555                             </fileSets>\r
556                             <destFile>${project.build.directory}/jacoco-dev.exec</destFile>\r
557                         </configuration>\r
558                     </execution>\r
559                                 </executions>\r
560                         </plugin>\r
561                 \r
562                         </plugins>\r
563 \r
564         </build>\r
565 \r
566 \r
567                 <distributionManagement>\r
568                 <repository>\r
569                         <id>ecomp-releases</id>\r
570                         <name>AAF Release Repository</name>\r
571                         <url>${nexusproxy}${releaseNexusPath}</url>\r
572                 </repository>\r
573                 <snapshotRepository>\r
574                         <id>ecomp-snapshots</id>\r
575                         <name>AAF Snapshot Repository</name>\r
576                         <url>${nexusproxy}${snapshotNexusPath}</url>\r
577                 </snapshotRepository>\r
578                 <site>\r
579                         <id>ecomp-site</id>\r
580                         <url>dav:${nexusproxy}${sitePath}</url>\r
581                 </site>\r
582         </distributionManagement>\r
583  <profiles>\r
584     <profile>\r
585       <id>docker</id>\r
586       <properties>\r
587         <skip.staging.artifacts>true</skip.staging.artifacts>\r
588         <skip.docker.build>false</skip.docker.build>\r
589         <skip.docker.tag>false</skip.docker.tag>\r
590         <skip.docker.push>false</skip.docker.push>\r
591       </properties>\r
592     </profile>\r
593   </profiles>\r
594 </project>\r