Switched from Dropwizard to Springboot
[holmes/engine-management.git] / engine-d-standalone / pom.xml
1 <?xml version="1.0"?>
2 <!--
3
4     Copyright 2017-2020 ZTE Corporation.
5
6     Licensed under the Apache License, Version 2.0 (the "License");
7     you may not use this file except in compliance with the License.
8     You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12     Unless required by applicable law or agreed to in writing, software
13     distributed under the License is distributed on an "AS IS" BASIS,
14     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15     See the License for the specific language governing permissions and
16     limitations under the License.
17
18 -->
19 <project xmlns="http://maven.apache.org/POM/4.0.0"
20          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22     <parent>
23         <groupId>org.onap.holmes.engine-management</groupId>
24         <artifactId>holmes-engine-parent</artifactId>
25         <version>1.3.8-SNAPSHOT</version>
26     </parent>
27
28     <artifactId>holmes-engine-d-standalone</artifactId>
29     <modelVersion>4.0.0</modelVersion>
30     <name>holmes-engine/holmes-engine-d-standalone</name>
31     <packaging>pom</packaging>
32
33     <properties>
34         <holmes.engine.project.version>${project.version}</holmes.engine.project.version>
35         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
36         <build.number>${maven.build.timestamp}</build.number>
37     </properties>
38
39     <dependencies>
40         <dependency>
41             <groupId>org.onap.holmes.engine-management</groupId>
42             <artifactId>holmes-engine-d</artifactId>
43             <version>${project.version}</version>
44         </dependency>
45     </dependencies>
46
47     <build>
48         <plugins>
49             <plugin>
50                 <groupId>org.apache.maven.plugins</groupId>
51                 <artifactId>maven-dependency-plugin</artifactId>
52                 <executions>
53                     <execution>
54                         <id>copy-dependencies</id>
55                         <phase>process-resources</phase>
56                         <goals>
57                             <goal>copy-dependencies</goal>
58                         </goals>
59                     </execution>
60                 </executions>
61                 <configuration>
62                     <outputDirectory>${linux64outputdir}/lib</outputDirectory>
63                     <overWriteIfNewer>true</overWriteIfNewer>
64                     <includeScope>runtime</includeScope>
65                 </configuration>
66             </plugin>
67             <plugin>
68                 <artifactId>maven-resources-plugin</artifactId>
69                 <executions>
70                     <execution>
71                         <id>copy-resources-${linux64id}</id>
72                         <phase>process-resources</phase>
73                         <goals>
74                             <goal>copy-resources</goal>
75                         </goals>
76                         <configuration>
77                             <outputDirectory>${linux64outputdir}</outputDirectory>
78                             <resources>
79                                 <resource>
80                                     <directory>src/main/assembly/</directory>
81                                     <filtering>false</filtering>
82                                     <includes>
83                                         <include>**/*</include>
84                                     </includes>
85                                     <excludes>
86                                         <exclude>**/*.bat</exclude>
87                                     </excludes>
88                                 </resource>
89                                 <resource>
90                                     <directory>../engine-d/src/main/resources</directory>
91                                     <excludes>
92                                         <exclude>logback-spring.xml</exclude>
93                                     </excludes>
94                                     <filtering>false</filtering>
95                                 </resource>
96                             </resources>
97                             <overwrite>true</overwrite>
98                         </configuration>
99                     </execution>
100                     <execution>
101                         <id>copy-dockerfile</id>
102                         <phase>process-resources</phase>
103                         <goals>
104                             <goal>copy-resources</goal>
105                         </goals>
106                         <configuration>
107                             <outputDirectory>target/version</outputDirectory>
108                             <resources>
109                                 <resource>
110                                     <directory>src/main/assembly/</directory>
111                                     <filtering>false</filtering>
112                                     <includes>
113                                         <include>Dockerfile</include>
114                                     </includes>
115                                 </resource>
116                             </resources>
117                             <overwrite>true</overwrite>
118                         </configuration>
119                     </execution>
120                 </executions>
121             </plugin>
122             <plugin>
123                 <groupId>org.apache.maven.plugins</groupId>
124                 <artifactId>maven-assembly-plugin</artifactId>
125                 <executions>
126                     <execution>
127                         <id>linux64</id>
128                         <configuration>
129                             <descriptors>
130                                 <descriptor>linux64-assembly.xml</descriptor>
131                             </descriptors>
132                             <appendAssemblyId>true</appendAssemblyId>
133                             <outputDirectory>target/version</outputDirectory>
134                         </configuration>
135                         <phase>package</phase>
136                         <goals>
137                             <goal>attached</goal>
138                         </goals>
139                     </execution>
140                 </executions>
141             </plugin>
142             <plugin>
143                 <groupId>org.codehaus.gmaven</groupId>
144                 <artifactId>groovy-maven-plugin</artifactId>
145                 <executions>
146                     <execution>
147                         <phase>validate</phase>
148                         <goals>
149                             <goal>execute</goal>
150                         </goals>
151                         <configuration>
152                             <source>
153                                 println project.properties['holmes.engine.project.version'];
154                                 def versionArray;
155                                 if (project.properties['holmes.engine.project.version'] != null) {
156                                     versionArray = project.properties['holmes.engine.project.version'].split('-');
157                                 }
158
159                                 project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
160                                 project.properties['project.docker.latesttag.version.with.timestamp'] = versionArray[0] + "-STAGING-${build.number}";
161
162                                 println 'New Tag for docker:' +
163                                         project.properties['project.docker.latesttag.version'];
164                             </source>
165                         </configuration>
166                     </execution>
167                 </executions>
168             </plugin>
169         </plugins>
170     </build>
171
172     <profiles>
173         <profile>
174             <id>docker</id>
175             <build>
176                 <plugins>
177                     <plugin>
178                         <groupId>io.fabric8</groupId>
179                         <artifactId>docker-maven-plugin</artifactId>
180                         <version>0.16.5</version>
181                         <inherited>false</inherited>
182                         <configuration>
183                             <images>
184                                 <image>
185                                     <name>onap/holmes/engine-management</name>
186                                     <build>
187                                         <cleanup>try</cleanup>
188                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
189                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
190                                         <tags>
191                                             <tag>${project.version}</tag>
192                                             <tag>${project.version}-${build.number}</tag>
193                                             <tag>${project.docker.latesttag.version}</tag>
194                                             <tag>${project.docker.latesttag.version.with.timestamp}</tag>
195                                         </tags>
196                                     </build>
197                                 </image>
198                             </images>
199                         </configuration>
200                         <executions>
201                             <execution>
202                                 <id>generate-images</id>
203                                 <phase>package</phase>
204                                 <goals>
205                                     <goal>build</goal>
206                                 </goals>
207                             </execution>
208
209                             <execution>
210                                 <id>push-images</id>
211                                 <phase>deploy</phase>
212                                 <goals>
213                                     <goal>build</goal>
214                                     <goal>push</goal>
215                                 </goals>
216                             </execution>
217                         </executions>
218                     </plugin>
219                 </plugins>
220             </build>
221         </profile>
222     </profiles>
223 </project>