Updated to Java 11
[holmes/rule-management.git] / rulemgt-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
20 <project xmlns="http://maven.apache.org/POM/4.0.0"
21          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23     <parent>
24         <groupId>org.onap.holmes.rule-management</groupId>
25         <artifactId>holmes-rulemgt-parent</artifactId>
26         <version>1.2.7-SNAPSHOT</version>
27     </parent>
28
29     <artifactId>holmes-rulemgt-standalone</artifactId>
30     <modelVersion>4.0.0</modelVersion>
31     <name>holmes-rulemgt/holmes-rulemgt-standalone</name>
32     <packaging>pom</packaging>
33
34     <properties>
35         <holmes.rule.project.version>${project.version}</holmes.rule.project.version>
36         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
37         <build.number>${maven.build.timestamp}</build.number>
38     </properties>
39
40     <dependencies>
41         <dependency>
42             <groupId>org.onap.holmes.rule-management</groupId>
43             <artifactId>holmes-rulemgt</artifactId>
44             <version>${project.version}</version>
45         </dependency>
46         <dependency>
47             <groupId>org.onap.holmes.rule-management</groupId>
48             <artifactId>holmes-rulemgt-frontend</artifactId>
49             <version>${project.version}</version>
50             <type>tar.gz</type>
51         </dependency>
52     </dependencies>
53
54     <build>
55         <plugins>
56             <plugin>
57                 <groupId>org.apache.maven.plugins</groupId>
58                 <artifactId>maven-dependency-plugin</artifactId>
59                 <executions>
60                     <execution>
61                         <id>copy-dependencies</id>
62                         <phase>process-resources</phase>
63                         <goals>
64                             <goal>copy-dependencies</goal>
65                         </goals>
66                     </execution>
67                 </executions>
68                 <configuration>
69                     <outputDirectory>${linux64outputdir}/lib</outputDirectory>
70                     <includeScope>runtime</includeScope>
71                 </configuration>
72             </plugin>
73             <plugin>
74                 <artifactId>maven-resources-plugin</artifactId>
75                 <executions>
76                     <execution>
77                         <id>copy-resources-${linux64id}</id>
78                         <phase>process-resources</phase>
79                         <goals>
80                             <goal>copy-resources</goal>
81                         </goals>
82                         <configuration>
83                             <outputDirectory>${linux64outputdir}</outputDirectory>
84                             <resources>
85                                 <resource>
86                                     <directory>src/main/assembly/</directory>
87                                     <filtering>false</filtering>
88                                     <includes>
89                                         <include>**/*</include>
90                                     </includes>
91                                     <excludes>
92                                         <exclude>**/*.bat</exclude>
93                                     </excludes>
94                                 </resource>
95                                 <resource>
96                                     <directory>../rulemgt/src/main/resources</directory>
97                                     <filtering>false</filtering>
98                                 </resource>
99                             </resources>
100                             <overwrite>true</overwrite>
101                         </configuration>
102                     </execution>
103                     <execution>
104                         <id>copy-dockerfile</id>
105                         <phase>process-resources</phase>
106                         <goals>
107                             <goal>copy-resources</goal>
108                         </goals>
109                         <configuration>
110                             <outputDirectory>target/version</outputDirectory>
111                             <resources>
112                                 <resource>
113                                     <directory>src/main/assembly/</directory>
114                                     <filtering>false</filtering>
115                                     <includes>
116                                         <include>Dockerfile</include>
117                                     </includes>
118                                 </resource>
119                             </resources>
120                             <overwrite>true</overwrite>
121                         </configuration>
122                     </execution>
123                     <execution>
124                         <id>copy-nginx-conf-file</id>
125                         <phase>process-resources</phase>
126                         <goals>
127                             <goal>copy-resources</goal>
128                         </goals>
129                         <configuration>
130                             <outputDirectory>target/version</outputDirectory>
131                             <resources>
132                                 <resource>
133                                     <directory>src/main/assembly/</directory>
134                                     <filtering>false</filtering>
135                                     <includes>
136                                         <include>nginx-*.conf</include>
137                                         <include>**/holmes-frontend*.*</include>
138                                         <include>**/*.pem</include>
139                                     </includes>
140                                 </resource>
141                             </resources>
142                             <overwrite>true</overwrite>
143                         </configuration>
144                     </execution>
145                 </executions>
146             </plugin>
147             <plugin>
148                 <groupId>org.apache.maven.plugins</groupId>
149                 <artifactId>maven-dependency-plugin</artifactId>
150                 <executions>
151                     <execution>
152                         <id>copy-artifacts-${linux64id}</id>
153                         <goals>
154                             <goal>copy</goal>
155                         </goals>
156                         <phase>prepare-package</phase>
157                         <configuration>
158                             <artifactItems>
159                                 <artifactItem>
160                                     <groupId>org.onap.holmes.rule-management</groupId>
161                                     <artifactId>holmes-rulemgt-frontend</artifactId>
162                                     <type>tar.gz</type>
163                                     <overWrite>true</overWrite>
164                                     <outputDirectory>target/version</outputDirectory>
165                                     <destFileName>holmes-rulemgt-frontend-${project.version}.tar.gz</destFileName>
166                                 </artifactItem>
167                             </artifactItems>
168                         </configuration>
169                     </execution>
170                 </executions>
171             </plugin>
172             <plugin>
173                 <groupId>org.apache.maven.plugins</groupId>
174                 <artifactId>maven-assembly-plugin</artifactId>
175                 <executions>
176                     <execution>
177                         <id>linux64</id>
178                         <configuration>
179                             <descriptors>
180                                 <descriptor>linux64-assembly.xml</descriptor>
181                             </descriptors>
182                             <appendAssemblyId>true</appendAssemblyId>
183                             <outputDirectory>target/version</outputDirectory>
184                         </configuration>
185                         <phase>package</phase>
186                         <goals>
187                             <goal>attached</goal>
188                         </goals>
189                     </execution>
190                 </executions>
191             </plugin>
192             <plugin>
193                 <groupId>org.codehaus.gmaven</groupId>
194                 <artifactId>groovy-maven-plugin</artifactId>
195                 <executions>
196                     <execution>
197                         <phase>validate</phase>
198                         <goals>
199                             <goal>execute</goal>
200                         </goals>
201                         <configuration>
202                             <source>
203                                 println project.properties['holmes.rule.project.version'];
204                                 def versionArray;
205                                 if (project.properties['holmes.rule.project.version'] != null) {
206                                     versionArray = project.properties['holmes.rule.project.version'].split('-');
207                                 }
208
209                                 project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
210                                 project.properties['project.docker.latesttag.version.with.timestamp'] = versionArray[0] + "-STAGING-${build.number}";
211
212                                 println 'New Tag for docker:' +
213                                         project.properties['project.docker.latesttag.version'];
214                             </source>
215                         </configuration>
216                     </execution>
217                 </executions>
218             </plugin>
219         </plugins>
220     </build>
221
222     <profiles>
223         <profile>
224             <id>docker</id>
225             <build>
226                 <plugins>
227                     <plugin>
228                         <groupId>io.fabric8</groupId>
229                         <artifactId>docker-maven-plugin</artifactId>
230                         <version>0.16.5</version>
231                         <inherited>false</inherited>
232                         <configuration>
233                             <images>
234                                 <image>
235                                     <name>onap/holmes/rule-management</name>
236                                     <build>
237                                         <cleanup>try</cleanup>
238                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
239                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
240                                         <tags>
241                                             <tag>${project.version}</tag>
242                                             <tag>${project.version}-${build.number}</tag>
243                                             <tag>${project.docker.latesttag.version}</tag>
244                                             <tag>${project.docker.latesttag.version.with.timestamp}</tag>
245                                         </tags>
246                                     </build>
247                                 </image>
248                             </images>
249                         </configuration>
250                         <executions>
251                             <execution>
252                                 <id>generate-images</id>
253                                 <phase>package</phase>
254                                 <goals>
255                                     <goal>build</goal>
256                                 </goals>
257                             </execution>
258
259                             <execution>
260                                 <id>push-images</id>
261                                 <phase>deploy</phase>
262                                 <goals>
263                                     <goal>build</goal>
264                                     <goal>push</goal>
265                                 </goals>
266                             </execution>
267                         </executions>
268                     </plugin>
269                 </plugins>
270             </build>
271         </profile>
272     </profiles>
273 </project>