Fixed the Start-up Failure in the Dualstack Env
[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.3-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                     <includeScope>runtime</includeScope>
64                 </configuration>
65             </plugin>
66             <plugin>
67                 <artifactId>maven-resources-plugin</artifactId>
68                 <executions>
69                     <execution>
70                         <id>copy-resources-${linux64id}</id>
71                         <phase>process-resources</phase>
72                         <goals>
73                             <goal>copy-resources</goal>
74                         </goals>
75                         <configuration>
76                             <outputDirectory>${linux64outputdir}</outputDirectory>
77                             <resources>
78                                 <resource>
79                                     <directory>src/main/assembly/</directory>
80                                     <filtering>false</filtering>
81                                     <includes>
82                                         <include>**/*</include>
83                                     </includes>
84                                     <excludes>
85                                         <exclude>**/*.bat</exclude>
86                                     </excludes>
87                                 </resource>
88                                 <resource>
89                                     <directory>../engine-d/src/main/resources</directory>
90                                     <filtering>false</filtering>
91                                 </resource>
92                             </resources>
93                             <overwrite>true</overwrite>
94                         </configuration>
95                     </execution>
96                     <execution>
97                         <id>copy-dockerfile</id>
98                         <phase>process-resources</phase>
99                         <goals>
100                             <goal>copy-resources</goal>
101                         </goals>
102                         <configuration>
103                             <outputDirectory>target/version</outputDirectory>
104                             <resources>
105                                 <resource>
106                                     <directory>src/main/assembly/</directory>
107                                     <filtering>false</filtering>
108                                     <includes>
109                                         <include>Dockerfile</include>
110                                     </includes>
111                                 </resource>
112                             </resources>
113                             <overwrite>true</overwrite>
114                         </configuration>
115                     </execution>
116                 </executions>
117             </plugin>
118             <plugin>
119                 <groupId>org.apache.maven.plugins</groupId>
120                 <artifactId>maven-assembly-plugin</artifactId>
121                 <executions>
122                     <execution>
123                         <id>linux64</id>
124                         <configuration>
125                             <descriptors>
126                                 <descriptor>linux64-assembly.xml</descriptor>
127                             </descriptors>
128                             <appendAssemblyId>true</appendAssemblyId>
129                             <outputDirectory>target/version</outputDirectory>
130                         </configuration>
131                         <phase>package</phase>
132                         <goals>
133                             <goal>attached</goal>
134                         </goals>
135                     </execution>
136                 </executions>
137             </plugin>
138             <plugin>
139                 <groupId>org.codehaus.gmaven</groupId>
140                 <artifactId>groovy-maven-plugin</artifactId>
141                 <executions>
142                     <execution>
143                         <phase>validate</phase>
144                         <goals>
145                             <goal>execute</goal>
146                         </goals>
147                         <configuration>
148                             <source>
149                                 println project.properties['holmes.engine.project.version'];
150                                 def versionArray;
151                                 if (project.properties['holmes.engine.project.version'] != null) {
152                                     versionArray = project.properties['holmes.engine.project.version'].split('-');
153                                 }
154
155                                 project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
156                                 project.properties['project.docker.latesttag.version.with.timestamp'] = versionArray[0] + "-STAGING-${build.number}";
157
158                                 println 'New Tag for docker:' +
159                                         project.properties['project.docker.latesttag.version'];
160                             </source>
161                         </configuration>
162                     </execution>
163                 </executions>
164             </plugin>
165         </plugins>
166     </build>
167
168     <profiles>
169         <profile>
170             <id>docker</id>
171             <build>
172                 <plugins>
173                     <plugin>
174                         <groupId>io.fabric8</groupId>
175                         <artifactId>docker-maven-plugin</artifactId>
176                         <version>0.16.5</version>
177                         <inherited>false</inherited>
178                         <configuration>
179                             <images>
180                                 <image>
181                                     <name>onap/holmes/engine-management</name>
182                                     <build>
183                                         <cleanup>try</cleanup>
184                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
185                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
186                                         <tags>
187                                             <tag>${project.version}</tag>
188                                             <tag>${project.version}-${build.number}</tag>
189                                             <tag>${project.docker.latesttag.version}</tag>
190                                             <tag>${project.docker.latesttag.version.with.timestamp}</tag>
191                                         </tags>
192                                     </build>
193                                 </image>
194                             </images>
195                         </configuration>
196                         <executions>
197                             <execution>
198                                 <id>generate-images</id>
199                                 <phase>package</phase>
200                                 <goals>
201                                     <goal>build</goal>
202                                 </goals>
203                             </execution>
204
205                             <execution>
206                                 <id>push-images</id>
207                                 <phase>deploy</phase>
208                                 <goals>
209                                     <goal>build</goal>
210                                     <goal>push</goal>
211                                 </goals>
212                             </execution>
213                         </executions>
214                     </plugin>
215                 </plugins>
216             </build>
217         </profile>
218     </profiles>
219 </project>