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.12.1-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.40.2</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>
45 <logback.version>1.2.7</logback.version>
48 Location where assembly of our scripts, resources and main jar will be held
49 Check the ${project.artifactId}/src/main/assembly/descriptor.xml for more info
51 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
52 </aai.build.directory>
53 <aai.docker.namespace>onap</aai.docker.namespace>
54 <aai.base.image>alpine</aai.base.image>
55 <aai.base.image.version>1.8.1</aai.base.image.version>
57 <maven.skip.tests>true</maven.skip.tests>
59 <jacoco.line.coverage.limit>0.44</jacoco.line.coverage.limit>
61 <!-- This will be used for the docker images as the default format of maven build has issues -->
62 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
63 <javadoc.plugin.version>3.4.1</javadoc.plugin.version>
65 <!-- Start of Default ONAP Schema Properties -->
66 <schema.source.name>onap</schema.source.name>
67 <schema.configuration.location>N/A</schema.configuration.location>
68 <schema.nodes.location>${project.basedir}/src/main/resources/schema/${schema.source.name}/oxm
69 </schema.nodes.location>
70 <schema.edges.location>${project.basedir}/src/main/resources/schema/${schema.source.name}/dbedgerules
71 </schema.edges.location>
72 <schema.version.depth.start>v10</schema.version.depth.start>
73 <schema.version.related.link.start>v10</schema.version.related.link.start>
74 <schema.version.app.root.start>v11</schema.version.app.root.start>
75 <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
76 <schema.version.edge.label.start>v12</schema.version.edge.label.start>
77 <schema.version.api.default>v27</schema.version.api.default>
78 <schema.version.list>v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27</schema.version.list>
79 <schema.uri.base.path>/aai/schema-service</schema.uri.base.path>
80 <!-- End of Default ONAP Schema Properties -->
82 <!-- Setting some default value to not complain by editor but it will be overridden by gmaven plugin -->
85 <!-- Docker profile to be used for building docker image and pushing to nexus -->
91 <groupId>org.codehaus.groovy.maven</groupId>
92 <artifactId>gmaven-plugin</artifactId>
95 <phase>pre-clean</phase>
99 <phase>pre-clean</phase>
105 def userAaiBaseImage = session.userProperties['aai.base.image'];
106 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
107 if (userAaiCommonVersion != null) {
108 project.properties['aai.base.image.version'] = userAaiCommonVersion;
110 if (userAaiBaseImage != null) {
111 project.properties['aai.base.image'] = userAaiBaseImage;
113 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
114 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
121 <groupId>io.fabric8</groupId>
122 <artifactId>docker-maven-plugin</artifactId>
123 <version>${docker.fabric.version}</version>
125 <verbose>true</verbose>
126 <apiVersion>1.23</apiVersion>
129 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
134 <tag>${project.docker.latesttag.version}</tag>
135 <tag>${project.major.version}.${project.minor.version}-STAGING-${maven.build.timestamp}</tag>
137 <cleanup>try</cleanup>
138 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
143 <directory>${aai.build.directory}</directory>
144 <outputDirectory>/${project.artifactId}</outputDirectory>
155 <id>clean-images</id>
156 <phase>pre-clean</phase>
161 <removeAll>true</removeAll>
165 <id>generate-images</id>
166 <phase>verify</phase>
173 <phase>deploy</phase>
183 <!-- Start of ONAP Profile -->
187 <schema.source.name>onap</schema.source.name>
188 <schema.version.namespace.change.start>v12</schema.version.namespace.change.start>
189 <schema.version.list>v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27</schema.version.list>
192 <!-- End of ONAP Profile -->
196 <skipTests>${maven.skip.tests}</skipTests>
199 <defaultGoal>pre-integration-test</defaultGoal>
202 <groupId>org.codehaus.mojo</groupId>
203 <artifactId>exec-maven-plugin</artifactId>
204 <version>3.1.0</version>
207 <id>run-spring-boot</id>
208 <phase>package</phase>
215 <mainClass>${start-class}</mainClass>
218 <key>schema.source.name</key>
219 <value>${schema.source.name}</value>
222 <key>schema.configuration.location</key>
223 <value>${schema.configuration.location}</value>
226 <key>schema.nodes.location</key>
227 <value>${schema.nodes.location}</value>
230 <key>schema.edges.location</key>
231 <value>${schema.edges.location}</value>
234 <key>schema.version.depth.start</key>
235 <value>${schema.version.depth.start}</value>
238 <key>schema.version.related.link.start</key>
239 <value>${schema.version.related.link.start}</value>
242 <key>schema.version.app.root.start</key>
243 <value>${schema.version.app.root.start}</value>
246 <key>schema.version.namespace.change.start</key>
247 <value>${schema.version.namespace.change.start}</value>
250 <key>schema.version.edge.label.start</key>
251 <value>${schema.version.edge.label.start}</value>
254 <key>schema.version.api.default</key>
255 <value>${schema.version.api.default}</value>
258 <key>schema.version.list</key>
259 <value>${schema.version.list}</value>
262 <key>schema.uri.base.path</key>
263 <value>${schema.uri.base.path}</value>
266 <executable>java</executable>
275 <groupId>jakarta.xml.bind</groupId>
276 <artifactId>jakarta.xml.bind-api</artifactId>
277 <version>3.0.0</version>
280 <groupId>javax.annotation</groupId>
281 <artifactId>javax.annotation-api</artifactId>
282 <scope>compile</scope>
285 <groupId>javax.el</groupId>
286 <artifactId>javax.el-api</artifactId>
287 <version>3.0.0</version>
290 <groupId>org.glassfish</groupId>
291 <artifactId>javax.el</artifactId>
292 <version>3.0.0</version>
295 <groupId>javax.jms</groupId>
296 <artifactId>javax.jms-api</artifactId>
297 <version>2.0.1</version>
300 <groupId>javax.ws.rs</groupId>
301 <artifactId>javax.ws.rs-api</artifactId>
302 <version>2.1</version>
305 <groupId>com.sun.xml.bind</groupId>
306 <artifactId>jaxb-impl</artifactId>
309 <groupId>com.sun.xml.bind</groupId>
310 <artifactId>jaxb-core</artifactId>
313 <groupId>com.att.eelf</groupId>
314 <artifactId>eelf-core</artifactId>
317 <groupId>ch.qos.logback</groupId>
318 <artifactId>logback-core</artifactId>
319 <version>${logback.version}</version>
322 <groupId>ch.qos.logback</groupId>
323 <artifactId>logback-classic</artifactId>
326 <groupId>ch.qos.logback</groupId>
327 <artifactId>logback-access</artifactId>
330 <groupId>junit</groupId>
331 <artifactId>junit</artifactId>
335 <groupId>com.google.guava</groupId>
336 <artifactId>guava</artifactId>
339 <groupId>com.fasterxml.jackson.jaxrs</groupId>
340 <artifactId>jackson-jaxrs-json-provider</artifactId>
343 <groupId>org.mockito</groupId>
344 <artifactId>mockito-all</artifactId>
348 <groupId>javax.xml.bind</groupId>
349 <artifactId>jaxb-api</artifactId>
350 <version>2.3.0</version>
353 <groupId>org.eclipse.persistence</groupId>
354 <artifactId>eclipselink</artifactId>
355 <version>3.0.0</version>
358 <groupId>org.eclipse.persistence</groupId>
359 <artifactId>org.eclipse.persistence.moxy</artifactId>
360 <version>3.0.0</version>
361 <scope>compile</scope>
364 <groupId>org.springframework.boot</groupId>
365 <artifactId>spring-boot-starter-jetty</artifactId>
368 <groupId>org.springframework.boot</groupId>
369 <artifactId>spring-boot-starter-jersey</artifactId>
372 <groupId>org.springframework.boot</groupId>
373 <artifactId>spring-boot-starter-aop</artifactId>
376 <groupId>org.onap.aai.aai-common</groupId>
377 <artifactId>aai-core</artifactId>
380 <groupId>org.springframework.boot</groupId>
381 <artifactId>spring-boot-starter-web</artifactId>
384 <groupId>org.onap.aai.aai-common</groupId>
385 <artifactId>aai-schema-ingest</artifactId>
390 <groupId>org.springframework.boot</groupId>
391 <artifactId>spring-boot-test</artifactId>
395 <groupId>org.springframework</groupId>
396 <artifactId>spring-test</artifactId>
400 <groupId>org.mockito</groupId>
401 <artifactId>mockito-all</artifactId>
405 <groupId>org.hamcrest</groupId>
406 <artifactId>hamcrest-junit</artifactId>
412 <directory>${project.basedir}/src/main/swm</directory>
413 <targetPath>${project.build.directory}/swm</targetPath>
414 <filtering>false</filtering>
417 <directory>${project.basedir}/src/main/resources</directory>
419 <include>application.properties</include>
420 <include>dme2.properties</include>
421 <include>logback.xml</include>
422 <include>localhost-access-logback.xml</include>
424 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
425 <filtering>false</filtering>
428 <directory>${project.basedir}/src/main/resources</directory>
430 <include>**/*</include>
432 <filtering>true</filtering>
435 <directory>${project.basedir}/src/main/resources/etc/appprops/</directory>
437 <include>aaiconfig.properties</include>
439 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
440 <filtering>false</filtering>
443 <directory>${project.basedir}/src/main/resources/etc/auth/</directory>
445 <include>aai-client-cert.p12</include>
446 <include>tomcat_keystore</include>
447 <include>aai_policy.json</include>
449 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
450 <filtering>true</filtering>
453 <directory>${project.basedir}/src/main/resources/</directory>
455 <include>logback.xml</include>
456 <include>localhost-access-logback.xml</include>
457 <include>hbase-site.xml</include>
459 <targetPath>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig</targetPath>
460 <filtering>true</filtering>
463 <directory>${project.basedir}/src/main/docker</directory>
465 <include>**/*</include>
467 <targetPath>${aai.build.directory}</targetPath>
468 <filtering>true</filtering>
471 <directory>${project.build.directory}/</directory>
473 <include>${project.artifactId}-${project.version}.jar</include>
475 <targetPath>${aai.build.directory}/lib/</targetPath>
476 <filtering>false</filtering>
482 <groupId>org.codehaus.groovy.maven</groupId>
483 <artifactId>gmaven-plugin</artifactId>
484 <version>1.0</version>
487 <phase>validate</phase>
493 println project.properties['aai.project.version'];
495 if (project.properties['aai.project.version'] != null) {
496 versionArray = project.properties['aai.project.version'].split('\\.');
499 project.properties["project.major.version"] = versionArray[0];
500 project.properties["project.minor.version"] = versionArray[1];
501 project.properties['project.docker.latesttag.version'] = versionArray[0] + '.' + versionArray[1] + '-STAGING-latest';
502 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
512 <groupId>org.springframework.boot</groupId>
513 <artifactId>spring-boot-maven-plugin</artifactId>
516 <groupId>org.apache.maven.plugins</groupId>
517 <artifactId>maven-clean-plugin</artifactId>
518 <version>3.2.0</version>
522 <directory>${project.basedir}/src/main/resources/schema</directory>
524 <include>**/*</include>
526 <followSymlinks>false</followSymlinks>
532 <groupId>org.codehaus.groovy.maven</groupId>
533 <artifactId>gmaven-plugin</artifactId>
536 <groupId>org.apache.maven.plugins</groupId>
537 <artifactId>maven-dependency-plugin</artifactId>
538 <version>3.3.0</version>
541 <groupId>org.apache.maven.plugins</groupId>
542 <artifactId>maven-javadoc-plugin</artifactId>
543 <version>${javadoc.plugin.version}</version>
546 <artifactId>maven-assembly-plugin</artifactId>
549 <descriptor>src/main/assembly/descriptor.xml</descriptor>
554 <id>make-assembly</id> <!-- this is used for inheritance merges -->
555 <phase>package</phase> <!-- bind to the packaging phase -->
563 <artifactId>maven-resources-plugin</artifactId>
564 <version>2.7</version>
567 <id>copy-oxm-edgerules-project</id>
568 <phase>initialize</phase>
570 <goal>copy-resources</goal>
573 <outputDirectory>${project.basedir}/src/main/resources/schema</outputDirectory>
576 <directory>${project.basedir}/../aai-schema/src/main/resources/</directory>
578 <include>**/oxm/**/*.xml</include>
579 <include>**/dbedgerules/**/*.json</include>
586 <id>copy-queries-project</id>
587 <phase>initialize</phase>
589 <goal>copy-resources</goal>
592 <outputDirectory>${project.basedir}/src/main/resources/schema</outputDirectory>
595 <directory>${project.basedir}/../aai-queries/src/main/resources/schema</directory>
597 <include>**/query/**/*.json</include>
604 <id>copy-oxm-edgerules</id>
605 <phase>initialize</phase>
607 <goal>copy-resources</goal>
610 <outputDirectory>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig/schema/</outputDirectory>
613 <directory>${project.basedir}/../aai-schema/src/main/resources/</directory>
615 <include>**/oxm/**/*.xml</include>
616 <include>**/dbedgerules/**/*.json</include>
623 <id>copy-queries</id>
624 <phase>initialize</phase>
626 <goal>copy-resources</goal>
629 <outputDirectory>${project.build.directory}/swm/package/nix/dist_files/opt/app/${project.artifactId}/appconfig/schema/</outputDirectory>
632 <directory>${project.basedir}/../aai-queries/src/main/resources/schema</directory>
634 <include>**/query/**/*.json</include>
641 <id>copy-fat-jar</id>
643 Reason the phase for this is set in the post integration phase due
644 to the spring boot maven plugin repackages post package phase
646 So basically first the spring boot plugin in phase package or pre package
647 only creates an jar without its dependencies
651 3.3 MB aai-schema-1.8.0-SNAPSHOT.jar
653 Then in the post package or during the package phase, it would get dependencies
654 and convert it into an fat jar
656 80 MB aai-schema-1.8.0-SNAPSHOT.jar
658 During the package phase if the copy of the above aai-schema-1.8.0-SNAPSHOT jar
659 was done, it would take the slim 3.3 MB jar and wouldn't include any of the dependencies
660 so thats why the phase for this exection must be in post the spring boot repackage phase
662 <phase>post-integration-test</phase>
664 <goal>copy-resources</goal>
667 <outputDirectory>${aai.build.directory}/lib/</outputDirectory>
670 <directory>${project.build.directory}/</directory>
672 <include>${project.artifactId}-${project.version}.jar</include>
674 <filtering>false</filtering>
682 <groupId>org.apache.maven.plugins</groupId>
683 <artifactId>maven-surefire-plugin</artifactId>
685 <runOrder>alphabetical</runOrder>
689 <groupId>com.mycila</groupId>
690 <artifactId>license-maven-plugin</artifactId>
693 <groupId>org.apache.maven.plugins</groupId>
694 <artifactId>maven-deploy-plugin</artifactId>
698 <groupId>org.springframework.boot</groupId>
699 <artifactId>spring-boot-maven-plugin</artifactId>
700 <version>${spring.boot.version}</version>
702 <mainClass>${start-class}</mainClass>
708 <goal>repackage</goal>
714 <groupId>org.apache.maven.plugins</groupId>
715 <artifactId>maven-clean-plugin</artifactId>
716 <version>3.2.0</version>
720 <directory>${project.basedir}/src/main/resources/schema</directory>
722 <include>**/*</include>
724 <followSymlinks>false</followSymlinks>
734 <groupId>org.apache.maven.plugins</groupId>
735 <artifactId>maven-javadoc-plugin</artifactId>
736 <version>3.4.1</version>
738 <failOnError>false</failOnError>
739 <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
741 <groupId>org.umlgraph</groupId>
742 <artifactId>umlgraph</artifactId>
743 <version>5.6.6</version>
745 <additionalparam>-views</additionalparam>
746 <useStandardDocletOptions>true</useStandardDocletOptions>