update link to upper-constraints.txt
[holmes/engine-management.git] / engine-d-standalone / pom.xml
1 <?xml version="1.0"?>
2 <!--
3
4     Copyright 2017-2023 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                             <tarLongFileMode>gnu</tarLongFileMode>
130                             <descriptors>
131                                 <descriptor>linux64-assembly.xml</descriptor>
132                             </descriptors>
133                             <appendAssemblyId>true</appendAssemblyId>
134                             <outputDirectory>target/version</outputDirectory>
135                         </configuration>
136                         <phase>package</phase>
137                         <goals>
138                             <goal>single</goal>
139                         </goals>
140                     </execution>
141                 </executions>
142             </plugin>
143             <plugin>
144                 <groupId>org.codehaus.gmaven</groupId>
145                 <artifactId>groovy-maven-plugin</artifactId>
146                 <executions>
147                     <execution>
148                         <phase>validate</phase>
149                         <goals>
150                             <goal>execute</goal>
151                         </goals>
152                         <configuration>
153                             <source>
154                                 println project.properties['holmes.engine.project.version'];
155                                 def versionArray;
156                                 if (project.properties['holmes.engine.project.version'] != null) {
157                                     versionArray = project.properties['holmes.engine.project.version'].split('-');
158                                 }
159
160                                 project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
161                                 project.properties['project.docker.latesttag.version.with.timestamp'] = versionArray[0] + "-STAGING-${build.number}";
162
163                                 println 'New Tag for docker:' +
164                                         project.properties['project.docker.latesttag.version'];
165                             </source>
166                         </configuration>
167                     </execution>
168                 </executions>
169             </plugin>
170         </plugins>
171     </build>
172
173     <profiles>
174         <profile>
175             <id>docker</id>
176             <build>
177                 <plugins>
178                     <plugin>
179                         <groupId>io.fabric8</groupId>
180                         <artifactId>docker-maven-plugin</artifactId>
181                         <version>0.16.5</version>
182                         <inherited>false</inherited>
183                         <configuration>
184                             <images>
185                                 <image>
186                                     <name>onap/holmes/engine-management</name>
187                                     <build>
188                                         <cleanup>try</cleanup>
189                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
190                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
191                                         <tags>
192                                             <tag>${project.version}</tag>
193                                             <tag>${project.version}-${build.number}</tag>
194                                             <tag>${project.docker.latesttag.version}</tag>
195                                             <tag>${project.docker.latesttag.version.with.timestamp}</tag>
196                                         </tags>
197                                     </build>
198                                 </image>
199                             </images>
200                         </configuration>
201                         <executions>
202                             <execution>
203                                 <id>generate-images</id>
204                                 <phase>package</phase>
205                                 <goals>
206                                     <goal>build</goal>
207                                 </goals>
208                             </execution>
209
210                             <execution>
211                                 <id>push-images</id>
212                                 <phase>deploy</phase>
213                                 <goals>
214                                     <goal>build</goal>
215                                     <goal>push</goal>
216                                 </goals>
217                             </execution>
218                         </executions>
219                     </plugin>
220                 </plugins>
221             </build>
222         </profile>
223     </profiles>
224 </project>