1 <?xml version="1.0" encoding="UTF-8"?>
4 ============LICENSE_START=======================================================
6 ================================================================================
7 Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
8 ================================================================================
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 ============LICENSE_END=========================================================
23 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
24 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25 <modelVersion>4.0.0</modelVersion>
27 <groupId>org.onap.aai.schema-service</groupId>
28 <artifactId>schema-service</artifactId>
29 <version>1.9.2-SNAPSHOT</version>
31 <groupId>org.onap.aai.schema-service</groupId>
32 <artifactId>aai-schema-service</artifactId>
34 <java.version>1.8</java.version>
35 <start-class>org.onap.aai.schemaservice.SchemaServiceApp</start-class>
37 <docker.fabric.version>0.28.0</docker.fabric.version>
38 <!-- Default docker registry that maven fabric plugin will try to pull from -->
39 <docker.registry>docker.io</docker.registry>
40 <!-- Specifying the docker push registry where the image should be pushed -->
41 <!-- This value should be overwritten at runtime to wherever need to be pushed to -->
42 <docker.push.registry>localhost:5000</docker.push.registry>
43 <aai.docker.version>1.0.0</aai.docker.version>
46 Location where assembly of our scripts, resources and main jar will be held
47 Check the ${project.artifactId}/src/main/assembly/descriptor.xml for more info
49 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
50 </aai.build.directory>
51 <aai.docker.namespace>onap</aai.docker.namespace>
52 <aai.base.image>alpine</aai.base.image>
53 <aai.base.image.version>1.8.1</aai.base.image.version>
55 <maven.skip.tests>true</maven.skip.tests>
57 <jacoco.line.coverage.limit>0.44</jacoco.line.coverage.limit>
59 <!-- This will be used for the docker images as the default format of maven build has issues -->
60 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
61 <javadoc.plugin.version>2.10.4</javadoc.plugin.version>
63 <!-- Start of Default ONAP Schema Properties -->
64 <schema.source.name>onap</schema.source.name>
65 <schema.configuration.location>N/A</schema.configuration.location>
66 <schema.nodes.location>${project.basedir}/src/main/resources/schema/${schema.source.name}/oxm
67 </schema.nodes.location>
68 <schema.edges.location>${project.basedir}/src/main/resources/schema/${schema.source.name}/dbedgerules
69 </schema.edges.location>
70 <schema.version.depth.start>v10</schema.version.depth.start>
71 <schema.version.related.link.start>v10</schema.version.related.link.start>
72 <schema.version.app.root.start>v11</schema.version.app.root.start>
73 <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
74 <schema.version.edge.label.start>v12</schema.version.edge.label.start>
75 <schema.version.api.default>v24</schema.version.api.default>
76 <schema.version.list>v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24</schema.version.list>
77 <schema.uri.base.path>/aai/schema-service</schema.uri.base.path>
78 <!-- End of Default ONAP Schema Properties -->
80 <!-- Setting some default value to not complain by editor but it will be overridden by gmaven plugin -->
83 <!-- Docker profile to be used for building docker image and pushing to nexus -->
89 <groupId>org.codehaus.groovy.maven</groupId>
90 <artifactId>gmaven-plugin</artifactId>
93 <phase>pre-clean</phase>
97 <phase>pre-clean</phase>
103 def userAaiBaseImage = session.userProperties['aai.base.image'];
104 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
105 if (userAaiCommonVersion != null) {
106 project.properties['aai.base.image.version'] = userAaiCommonVersion;
108 if (userAaiBaseImage != null) {
109 project.properties['aai.base.image'] = userAaiBaseImage;
111 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
112 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
119 <groupId>io.fabric8</groupId>
120 <artifactId>docker-maven-plugin</artifactId>
121 <version>${docker.fabric.version}</version>
123 <verbose>true</verbose>
124 <apiVersion>1.23</apiVersion>
127 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
132 <tag>${project.docker.latesttag.version}</tag>
133 <tag>${project.major.version}.${project.minor.version}-STAGING-${maven.build.timestamp}</tag>
135 <cleanup>try</cleanup>
136 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
141 <directory>${aai.build.directory}</directory>
142 <outputDirectory>/${project.artifactId}</outputDirectory>
153 <id>clean-images</id>
154 <phase>pre-clean</phase>
159 <removeAll>true</removeAll>
163 <id>generate-images</id>
164 <phase>verify</phase>
171 <phase>deploy</phase>
181 <!-- Start of ONAP Profile -->
185 <schema.source.name>onap</schema.source.name>
186 <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
187 <schema.version.list>v10,v11,v12,v13,v14,v15,v16,v17,18,v19,v20,v21,v22,v23,v24</schema.version.list>
190 <!-- End of ONAP Profile -->
194 <skipTests>${maven.skip.tests}</skipTests>
197 <defaultGoal>pre-integration-test</defaultGoal>
200 <groupId>org.codehaus.mojo</groupId>
201 <artifactId>exec-maven-plugin</artifactId>
202 <version>1.6.0</version>
205 <id>run-spring-boot</id>
206 <phase>package</phase>
213 <mainClass>${start-class}</mainClass>
216 <key>schema.source.name</key>
217 <value>${schema.source.name}</value>
220 <key>schema.configuration.location</key>
221 <value>${schema.configuration.location}</value>
224 <key>schema.nodes.location</key>
225 <value>${schema.nodes.location}</value>
228 <key>schema.edges.location</key>
229 <value>${schema.edges.location}</value>
232 <key>schema.version.depth.start</key>
233 <value>${schema.version.depth.start}</value>
236 <key>schema.version.related.link.start</key>
237 <value>${schema.version.related.link.start}</value>
240 <key>schema.version.app.root.start</key>
241 <value>${schema.version.app.root.start}</value>
244 <key>schema.version.namespace.change.start</key>
245 <value>${schema.version.namespace.change.start}</value>
248 <key>schema.version.edge.label.start</key>
249 <value>${schema.version.edge.label.start}</value>
252 <key>schema.version.api.default</key>
253 <value>${schema.version.api.default}</value>
256 <key>schema.version.list</key>
257 <value>${schema.version.list}</value>
260 <key>schema.uri.base.path</key>
261 <value>${schema.uri.base.path}</value>
264 <executable>java</executable>
273 <groupId>jakarta.xml.bind</groupId>
274 <artifactId>jakarta.xml.bind-api</artifactId>
275 <version>3.0.0</version>
278 <groupId>javax.annotation</groupId>
279 <artifactId>javax.annotation-api</artifactId>
280 <scope>compile</scope>
283 <groupId>javax.el</groupId>
284 <artifactId>javax.el-api</artifactId>
285 <version>3.0.0</version>
288 <groupId>org.glassfish</groupId>
289 <artifactId>javax.el</artifactId>
290 <version>3.0.0</version>
293 <groupId>javax.jms</groupId>
294 <artifactId>javax.jms-api</artifactId>
295 <version>2.0.1</version>
298 <groupId>javax.ws.rs</groupId>
299 <artifactId>javax.ws.rs-api</artifactId>
300 <version>2.1</version>
303 <groupId>com.sun.xml.bind</groupId>
304 <artifactId>jaxb-impl</artifactId>
307 <groupId>com.sun.xml.bind</groupId>
308 <artifactId>jaxb-core</artifactId>
311 <groupId>com.att.eelf</groupId>
312 <artifactId>eelf-core</artifactId>
315 <groupId>ch.qos.logback</groupId>
316 <artifactId>logback-core</artifactId>
319 <groupId>ch.qos.logback</groupId>
320 <artifactId>logback-classic</artifactId>
323 <groupId>ch.qos.logback</groupId>
324 <artifactId>logback-access</artifactId>
327 <groupId>junit</groupId>
328 <artifactId>junit</artifactId>
332 <groupId>com.google.guava</groupId>
333 <artifactId>guava</artifactId>
336 <groupId>com.fasterxml.jackson.jaxrs</groupId>
337 <artifactId>jackson-jaxrs-json-provider</artifactId>
340 <groupId>org.mockito</groupId>
341 <artifactId>mockito-all</artifactId>
345 <groupId>javax.xml.bind</groupId>
346 <artifactId>jaxb-api</artifactId>
347 <version>2.3.0</version>
350 <groupId>org.eclipse.persistence</groupId>
351 <artifactId>eclipselink</artifactId>
352 <version>3.0.0</version>
355 <groupId>org.eclipse.persistence</groupId>
356 <artifactId>org.eclipse.persistence.moxy</artifactId>
357 <version>3.0.0</version>
358 <scope>compile</scope>
361 <groupId>org.springframework.boot</groupId>
362 <artifactId>spring-boot-starter-jetty</artifactId>
365 <groupId>org.springframework.boot</groupId>
366 <artifactId>spring-boot-starter-jersey</artifactId>
369 <groupId>org.springframework.boot</groupId>
370 <artifactId>spring-boot-starter-aop</artifactId>
373 <groupId>org.onap.aai.aai-common</groupId>
374 <artifactId>aai-core</artifactId>
377 <groupId>org.springframework.boot</groupId>
378 <artifactId>spring-boot-starter-web</artifactId>
381 <groupId>org.onap.aai.aai-common</groupId>
382 <artifactId>aai-schema-ingest</artifactId>
387 <groupId>org.springframework.boot</groupId>
388 <artifactId>spring-boot-test</artifactId>
392 <groupId>org.springframework</groupId>
393 <artifactId>spring-test</artifactId>
397 <groupId>org.mockito</groupId>
398 <artifactId>mockito-all</artifactId>
402 <groupId>org.hamcrest</groupId>
403 <artifactId>hamcrest-junit</artifactId>
409 <directory>${project.basedir}/src/main/swm</directory>
410 <targetPath>${project.build.directory}/swm</targetPath>
411 <filtering>false</filtering>
414 <directory>${project.basedir}/src/main/resources</directory>
416 <include>application.properties</include>
417 <include>dme2.properties</include>
418 <include>logback.xml</include>
419 <include>localhost-access-logback.xml</include>
421 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
422 <filtering>false</filtering>
425 <directory>${project.basedir}/src/main/resources</directory>
427 <include>**/*</include>
429 <filtering>true</filtering>
432 <directory>${project.basedir}/src/main/resources/etc/appprops/</directory>
434 <include>aaiconfig.properties</include>
436 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
437 <filtering>false</filtering>
440 <directory>${project.basedir}/src/main/resources/etc/auth/</directory>
442 <include>aai-client-cert.p12</include>
443 <include>tomcat_keystore</include>
444 <include>aai_policy.json</include>
446 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
447 <filtering>true</filtering>
450 <directory>${project.basedir}/src/main/resources/</directory>
452 <include>logback.xml</include>
453 <include>localhost-access-logback.xml</include>
454 <include>hbase-site.xml</include>
456 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
457 <filtering>true</filtering>
460 <directory>${project.basedir}/src/main/docker</directory>
462 <include>**/*</include>
464 <targetPath>${aai.build.directory}</targetPath>
465 <filtering>true</filtering>
468 <directory>${project.build.directory}/</directory>
470 <include>${project.artifactId}-${project.version}.jar</include>
472 <targetPath>${aai.build.directory}/lib/</targetPath>
473 <filtering>false</filtering>
479 <groupId>org.codehaus.groovy.maven</groupId>
480 <artifactId>gmaven-plugin</artifactId>
481 <version>1.0</version>
484 <phase>validate</phase>
490 println project.properties['aai.project.version'];
492 if (project.properties['aai.project.version'] != null) {
493 versionArray = project.properties['aai.project.version'].split('\\.');
496 project.properties["project.major.version"] = versionArray[0];
497 project.properties["project.minor.version"] = versionArray[1];
498 project.properties['project.docker.latesttag.version'] = versionArray[0] + '.' + versionArray[1] + '-STAGING-latest';
499 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
509 <groupId>org.springframework.boot</groupId>
510 <artifactId>spring-boot-maven-plugin</artifactId>
513 <groupId>org.apache.maven.plugins</groupId>
514 <artifactId>maven-clean-plugin</artifactId>
515 <version>2.4.1</version>
519 <directory>${project.basedir}/src/main/resources/schema</directory>
521 <include>**/*</include>
523 <followSymlinks>false</followSymlinks>
529 <groupId>org.codehaus.groovy.maven</groupId>
530 <artifactId>gmaven-plugin</artifactId>
533 <groupId>org.apache.maven.plugins</groupId>
534 <artifactId>maven-dependency-plugin</artifactId>
535 <version>2.10</version>
538 <groupId>org.apache.maven.plugins</groupId>
539 <artifactId>maven-javadoc-plugin</artifactId>
540 <version>${javadoc.plugin.version}</version>
543 <artifactId>maven-assembly-plugin</artifactId>
546 <descriptor>src/main/assembly/descriptor.xml</descriptor>
551 <id>make-assembly</id> <!-- this is used for inheritance merges -->
552 <phase>package</phase> <!-- bind to the packaging phase -->
560 <artifactId>maven-resources-plugin</artifactId>
561 <version>2.7</version>
564 <id>copy-oxm-edgerules-project</id>
565 <phase>initialize</phase>
567 <goal>copy-resources</goal>
570 <outputDirectory>${project.basedir}/src/main/resources/schema</outputDirectory>
573 <directory>${project.basedir}/../aai-schema/src/main/resources/</directory>
575 <include>**/oxm/**/*.xml</include>
576 <include>**/dbedgerules/**/*.json</include>
583 <id>copy-queries-project</id>
584 <phase>initialize</phase>
586 <goal>copy-resources</goal>
589 <outputDirectory>${project.basedir}/src/main/resources/schema</outputDirectory>
592 <directory>${project.basedir}/../aai-queries/src/main/resources/schema</directory>
594 <include>**/query/**/*.json</include>
601 <id>copy-oxm-edgerules</id>
602 <phase>initialize</phase>
604 <goal>copy-resources</goal>
607 <outputDirectory>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig/schema/</outputDirectory>
610 <directory>${project.basedir}/../aai-schema/src/main/resources/</directory>
612 <include>**/oxm/**/*.xml</include>
613 <include>**/dbedgerules/**/*.json</include>
620 <id>copy-queries</id>
621 <phase>initialize</phase>
623 <goal>copy-resources</goal>
626 <outputDirectory>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig/schema/</outputDirectory>
629 <directory>${project.basedir}/../aai-queries/src/main/resources/schema</directory>
631 <include>**/query/**/*.json</include>
638 <id>copy-fat-jar</id>
640 Reason the phase for this is set in the post integration phase due
641 to the spring boot maven plugin repackages post package phase
643 So basically first the spring boot plugin in phase package or pre package
644 only creates an jar without its dependencies
648 3.3 MB aai-schema-1.8.0-SNAPSHOT.jar
650 Then in the post package or during the package phase, it would get dependencies
651 and convert it into an fat jar
653 80 MB aai-schema-1.8.0-SNAPSHOT.jar
655 During the package phase if the copy of the above aai-schema-1.8.0-SNAPSHOT jar
656 was done, it would take the slim 3.3 MB jar and wouldn't include any of the dependencies
657 so thats why the phase for this exection must be in post the spring boot repackage phase
659 <phase>post-integration-test</phase>
661 <goal>copy-resources</goal>
664 <outputDirectory>${aai.build.directory}/lib/</outputDirectory>
667 <directory>${project.build.directory}/</directory>
669 <include>${project.artifactId}-${project.version}.jar</include>
671 <filtering>false</filtering>
679 <groupId>org.apache.maven.plugins</groupId>
680 <artifactId>maven-surefire-plugin</artifactId>
682 <runOrder>alphabetical</runOrder>
686 <groupId>com.mycila</groupId>
687 <artifactId>license-maven-plugin</artifactId>
690 <groupId>org.apache.maven.plugins</groupId>
691 <artifactId>maven-deploy-plugin</artifactId>
695 <groupId>org.springframework.boot</groupId>
696 <artifactId>spring-boot-maven-plugin</artifactId>
697 <version>${spring.boot.version}</version>
699 <mainClass>${start-class}</mainClass>
705 <goal>repackage</goal>
711 <groupId>org.apache.maven.plugins</groupId>
712 <artifactId>maven-clean-plugin</artifactId>
713 <version>2.4.1</version>
717 <directory>${project.basedir}/src/main/resources/schema</directory>
719 <include>**/*</include>
721 <followSymlinks>false</followSymlinks>
731 <groupId>org.apache.maven.plugins</groupId>
732 <artifactId>maven-javadoc-plugin</artifactId>
733 <version>2.10.4</version>
735 <failOnError>false</failOnError>
736 <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
738 <groupId>org.umlgraph</groupId>
739 <artifactId>umlgraph</artifactId>
740 <version>5.6</version>
742 <additionalparam>-views</additionalparam>
743 <useStandardDocletOptions>true</useStandardDocletOptions>