Support maven deploy and docker build targets
[aai/champ.git] / champ-service / pom.xml
1 <!--
2 ============LICENSE_START=======================================================
3 org.onap.aai
4 ================================================================================
5 Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 Copyright © 2017-2018 Amdocs
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END=========================================================
20 -->
21 <project xmlns="http://maven.apache.org/POM/4.0.0"
22          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24     <modelVersion>4.0.0</modelVersion>
25
26     <parent>
27         <groupId>com.att.ajsc</groupId>
28         <artifactId>ajsc-archetype-parent</artifactId>
29         <version>2.0.0</version>
30     </parent>
31
32     <groupId>org.onap.aai</groupId>
33     <artifactId>champ-service</artifactId>
34     <version>1.2.0-SNAPSHOT</version>
35
36     <properties>
37         <runAjscHome>${basedir}/target/swm/package/nix/dist_files${distFilesRoot}</runAjscHome>
38         <ajscRuntimeVersion>2.0.0</ajscRuntimeVersion>
39
40         <absoluteDistFilesRoot>/appl/${project.artifactId}</absoluteDistFilesRoot>
41
42         <!-- For NO Versioning, REMOVE the /${project.version} from the <distFilesRoot>
43             property, below. PLEASE, NOTE: If your ${project.version} is a "-SNAPSHOT"
44             version, THIS will be used as your directory structure. If you do NOT want
45             this, simply remove the "-SNAPSHOT" from your <version> declaration at the
46             top of pom.xml -->
47         <distFilesRoot>/appl/${project.artifactId}/${project.version}</distFilesRoot>
48
49         <common.logging.groupid>org.onap.aai.logging-service</common.logging.groupid>
50         <common.logging.version>1.2.0</common.logging.version>
51         <org.apache.httpcomponents.httpclient.version>4.5.2</org.apache.httpcomponents.httpclient.version>
52
53         <docker.location>${basedir}/target</docker.location>
54         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
55     </properties>
56
57     <dependencies>
58         <dependency>
59             <groupId>com.sun.jersey</groupId>
60             <artifactId>jersey-core</artifactId>
61             <version>1.18.6</version>
62         </dependency>
63
64         <!-- AJSC Dependencies -->
65         <dependency>
66             <groupId>dom4j</groupId>
67             <artifactId>dom4j</artifactId>
68             <version>1.6.1</version>
69             <scope>provided</scope>
70         </dependency>
71         <dependency>
72             <groupId>com.att.aft</groupId>
73             <artifactId>dme2</artifactId>
74             <version>3.1.200</version>
75             <scope>provided</scope>
76         </dependency>
77
78         <!--Adding this dependency explicit.-->
79         <dependency>
80             <groupId>org.json</groupId>
81             <artifactId>json</artifactId>
82             <version>20160212</version>
83         </dependency>
84
85         <dependency>
86             <groupId>org.glassfish.jersey.core</groupId>
87             <artifactId>jersey-client</artifactId>
88             <version>2.23</version>
89         </dependency>
90
91         <dependency>
92             <groupId>commons-io</groupId>
93             <artifactId>commons-io</artifactId>
94             <version>2.4</version>
95         </dependency>
96
97         <dependency>
98             <groupId>com.google.code.gson</groupId>
99             <artifactId>gson</artifactId>
100             <version>2.6.2</version>
101         </dependency>
102
103         <dependency>
104             <groupId>${common.logging.groupid}</groupId>
105             <artifactId>common-logging</artifactId>
106             <version>${common.logging.version}</version>
107         </dependency>
108
109         <dependency>
110             <groupId>ch.qos.logback</groupId>
111             <artifactId>logback-core</artifactId>
112             <version>1.1.7</version>
113         </dependency>
114
115         <dependency>
116             <groupId>org.eclipse.persistence</groupId>
117             <artifactId>eclipselink</artifactId>
118             <version>2.6.2</version>
119         </dependency>
120
121         <dependency>
122             <groupId>org.apache.httpcomponents</groupId>
123             <artifactId>httpclient</artifactId>
124             <version>${org.apache.httpcomponents.httpclient.version}</version>
125         </dependency>
126
127         <!-- Champ graph database library. -->
128         <dependency>
129             <groupId>org.onap.aai</groupId>
130             <artifactId>champ-core</artifactId>
131             <version>1.2.0-SNAPSHOT</version>
132             <scope>compile</scope>
133             <exclusions>
134                 <exclusion>
135                     <groupId>org.apache.hbase</groupId>
136                     <artifactId>hbase-client</artifactId>
137                 </exclusion>
138             </exclusions>
139         </dependency>
140     </dependencies>
141
142     <distributionManagement>
143         <repository>
144             <id>ecomp-releases</id>
145             <name>ECOMP Release Repository</name>
146             <url>${onap.nexus.url}/content/repositories/releases/</url>
147         </repository>
148         <snapshotRepository>
149             <id>ecomp-snapshots</id>
150             <name>ECOMP Snapshot Repository</name>
151             <url>${onap.nexus.url}/content/repositories/snapshots/</url>
152         </snapshotRepository>
153     </distributionManagement>
154
155     <build>
156         <finalName>${project.artifactId}</finalName>
157         <plugins>
158             <plugin>
159                 <groupId>org.apache.maven.plugins</groupId>
160                 <artifactId>maven-resources-plugin</artifactId>
161                 <version>2.7</version>
162                 <executions>
163                     <execution>
164                         <id>copy-docker-file</id>
165                         <phase>package</phase>
166                         <goals>
167                             <goal>copy-resources</goal>
168                         </goals>
169                         <configuration>
170                             <outputDirectory>target</outputDirectory>
171                             <overwrite>true</overwrite>
172                             <resources>
173                                 <resource>
174                                     <directory>${basedir}/src/main/docker</directory>
175                                     <filtering>true</filtering>
176                                     <includes>
177                                         <include>**/*</include>
178                                     </includes>
179                                 </resource>
180                                 <resource>
181                                     <directory>${basedir}/src/main/bin/</directory>
182                                 </resource>
183                                 <resource>
184                                     <directory>../champ-service-deps-janus/target/</directory>
185                                 </resource>
186                                 <resource>
187                                     <directory>../champ-service-deps-titan/target/</directory>
188                                 </resource>
189                             </resources>
190                         </configuration>
191                     </execution>
192                 </executions>
193             </plugin>
194
195                         <!--
196             <plugin>
197                 <groupId>com.mycila</groupId>
198                 <artifactId>license-maven-plugin</artifactId>
199                 <version>3.0</version>
200                 <configuration>
201                     <header>License.txt</header>
202                     <includes>
203                         <include>src/main/java/**</include>
204                     </includes>
205                 </configuration>
206                 <executions>
207                     <execution>
208                         <goals>
209                             <goal>format</goal>
210                         </goals>
211                         <phase>process-sources</phase>
212                     </execution>
213                 </executions>
214             </plugin>
215                         -->
216             <plugin>
217                 <groupId>com.spotify</groupId>
218                 <artifactId>docker-maven-plugin</artifactId>
219                 <version>0.4.11</version>
220                 <configuration>
221                     <verbose>true</verbose>
222                     <serverId>docker-hub</serverId>
223                     <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
224                     <dockerDirectory>${docker.location}</dockerDirectory>
225                     <imageTags>
226                         <imageTag>latest</imageTag>
227                     </imageTags>
228                     <forceTags>true</forceTags>
229                 </configuration>
230             </plugin>
231
232             <plugin>
233                 <groupId>org.jacoco</groupId>
234                 <artifactId>jacoco-maven-plugin</artifactId>
235                 <version>0.7.9</version>
236                 <executions>
237                     <execution>
238                         <id>default-prepare-agent</id>
239                         <goals>
240                             <goal>prepare-agent</goal>
241                         </goals>
242                     </execution>
243                     <execution>
244                         <id>default-report</id>
245                         <phase>prepare-package</phase>
246                         <goals>
247                             <goal>report</goal>
248                         </goals>
249                     </execution>
250                     <execution>
251                         <id>default-check</id>
252                         <goals>
253                             <goal>check</goal>
254                         </goals>
255                         <configuration>
256                             <rules>
257                                 <!--  implementation is needed only for Maven 2  -->
258                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
259                                     <element>BUNDLE</element>
260                                     <limits>
261                                         <!--  implementation is needed only for Maven 2  -->
262                                         <limit implementation="org.jacoco.report.check.Limit">
263                                             <counter>INSTRUCTION</counter>
264                                             <value>COVEREDRATIO</value>
265                                             <minimum>.15</minimum>
266                                         </limit>
267                                         <limit implementation="org.jacoco.report.check.Limit">
268                                             <counter>BRANCH</counter>
269                                             <value>COVEREDRATIO</value>
270                                             <minimum>.12</minimum>
271                                         </limit>
272                                         <limit implementation="org.jacoco.report.check.Limit">
273                                             <counter>COMPLEXITY</counter>
274                                             <value>COVEREDRATIO</value>
275                                             <minimum>.15</minimum>
276                                         </limit>
277                                         <limit implementation="org.jacoco.report.check.Limit">
278                                             <counter>LINE</counter>
279                                             <value>COVEREDRATIO</value>
280                                             <minimum>.10</minimum>
281                                         </limit>
282                                         <limit implementation="org.jacoco.report.check.Limit">
283                                             <counter>METHOD</counter>
284                                             <value>COVEREDRATIO</value>
285                                             <minimum>.17</minimum>
286                                         </limit>
287                                         <limit implementation="org.jacoco.report.check.Limit">
288                                             <counter>CLASS</counter>
289                                             <value>MISSEDCOUNT</value>
290                                             <maximum>5</maximum>
291                                         </limit>
292                                     </limits>
293                                 </rule>
294                             </rules>
295                         </configuration>
296                     </execution>
297                 </executions>
298             </plugin>
299         </plugins>
300     </build>
301
302     <profiles>
303         <profile>
304             <id>runAjsc</id>
305             <build>
306                 <defaultGoal>initialize</defaultGoal>
307                 <plugins>
308                     <plugin>
309                         <groupId>org.codehaus.mojo</groupId>
310                         <artifactId>exec-maven-plugin</artifactId>
311                         <version>1.3.2</version>
312                         <executions>
313                             <execution>
314                                 <phase>initialize</phase>
315                                 <goals>
316                                     <goal>java</goal>
317                                 </goals>
318                                 <configuration>
319                                     <includeProjectDependencies>false</includeProjectDependencies>
320                                     <includePluginDependencies>true</includePluginDependencies>
321                                     <executable>java</executable>
322                                     <mainClass>com.att.ajsc.runner.Runner</mainClass>
323                                     <executableDependency>
324                                         <groupId>com.att.ajsc</groupId>
325                                         <artifactId>ajsc-runner</artifactId>
326                                     </executableDependency>
327                                     <additionalClasspathElements>
328                                         <additionalClasspathElement>${basedir}/ajsc-shared-config/etc</additionalClasspathElement>
329                                     </additionalClasspathElements>
330
331                                     <environmentVariables>
332                                         <AJSC_HOME>${runAjscHome}</AJSC_HOME>
333                                     </environmentVariables>
334
335                                     <!-- Main AJSC System Properties below (necessary for proper startup) -->
336                                     <systemProperties>
337                                         <systemProperty>
338                                             <key>AJSC_HOME</key>
339                                             <value>${runAjscHome}</value>
340                                         </systemProperty>
341                                         <systemProperty>
342                                             <key>CONFIG_HOME</key>
343                                             <value>${basedir}/appconfig-local/</value>
344                                         </systemProperty>
345                                         <systemProperty>
346                                             <key>AJSC_CONF_HOME</key>
347                                             <value>${basedir}/bundleconfig-local</value>
348                                         </systemProperty>
349                                         <systemProperty>
350                                             <key>logback.configurationFile</key>
351                                             <value>${basedir}/ajsc-shared-config/etc/logback.xml</value>
352                                         </systemProperty>
353                                         <systemProperty>
354                                             <key>AJSC_SHARED_CONFIG</key>
355                                             <value>${basedir}/ajsc-shared-config</value>
356                                         </systemProperty>
357
358                                         <sysproperty>
359                                             <key>AJSC_EXTERNAL_LIB_FOLDERS</key>
360                                             <value>${basedir}/target/commonLibs</value>
361                                         </sysproperty>
362                                         <sysproperty>
363                                             <key>AJSC_EXTERNAL_PROPERTIES_FOLDERS</key>
364                                             <value>${basedir}/ajsc-shared-config/etc</value>
365                                         </sysproperty>
366
367                                         <systemProperty>
368                                             <key>AJSC_SERVICE_NAMESPACE</key>
369                                             <value>${module.ajsc.namespace.name}</value>
370                                         </systemProperty>
371                                         <systemProperty>
372                                             <key>AJSC_SERVICE_VERSION</key>
373                                             <value>${module.ajsc.namespace.version}</value>
374                                         </systemProperty>
375                                         <systemProperty>
376                                             <key>SOACLOUD_SERVICE_VERSION</key>
377                                             <value>${project.version}</value>
378                                         </systemProperty>
379                                         <systemProperty>
380                                             <key>server.port</key>
381                                             <value>${serverPort}</value>
382                                         </systemProperty>
383                                     </systemProperties>
384
385                                     <!-- Command Line Arguments to add to the java command. Here, you
386                                         can specify the port as well as the Context you want your service to run
387                                         in. Use context=/ to run in an unnamed Context (Root Context). The default
388                                         configuration of the AJSC is to run under the / Context. Setting the port
389                                         here can aid during the development phase of your service. However, you can
390                                         leave this argument out entirely, and the AJSC will default to using an Ephemeral
391                                         port. -->
392                                     <arguments>
393                                         <argument>context=/</argument>
394                                         <argument>port=${serverPort}</argument>
395                                         <argument>sslport=${sslport}</argument>
396                                     </arguments>
397                                 </configuration>
398                             </execution>
399                         </executions>
400                         <configuration>
401                             <executable>java</executable>
402                         </configuration>
403                         <dependencies>
404                             <dependency>
405                                 <groupId>com.att.ajsc</groupId>
406                                 <artifactId>ajsc-runner</artifactId>
407                                 <version>${ajscRuntimeVersion}</version>
408                             </dependency>
409                         </dependencies>
410                     </plugin>
411                 </plugins>
412             </build>
413         </profile>
414     </profiles>
415 </project>