Merge "Add the frontend into the final package"
[holmes/rule-management.git] / rulemgt-standalone / pom.xml
1 <?xml version="1.0"?>
2 <!--
3
4     Copyright 2017 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.rule-management</groupId>
24         <artifactId>holmes-rulemgt-parent</artifactId>
25         <version>1.1.0-SNAPSHOT</version>
26     </parent>
27
28     <artifactId>holmes-rulemgt-standalone</artifactId>
29     <modelVersion>4.0.0</modelVersion>
30     <name>holmes-rulemgt/holmes-rulemgt-standalone</name>
31     <packaging>pom</packaging>
32
33     <properties>
34         <holmes.rule.project.version>${project.version}</holmes.rule.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     <build>
40         <plugins>
41             <plugin>
42                 <artifactId>maven-resources-plugin</artifactId>
43                 <executions>
44                     <execution>
45                         <id>copy-resources-${linux64id}</id>
46                         <phase>process-resources</phase>
47                         <goals>
48                             <goal>copy-resources</goal>
49                         </goals>
50                         <configuration>
51                             <outputDirectory>${linux64outputdir}</outputDirectory>
52                             <resources>
53                                 <resource>
54                                     <directory>src/main/assembly/</directory>
55                                     <filtering>false</filtering>
56                                     <includes>
57                                         <include>**/*</include>
58                                     </includes>
59                                     <excludes>
60                                         <exclude>**/*.bat</exclude>
61                                         <exclude>Dockerfile</exclude>
62                                     </excludes>
63                                 </resource>
64                                 <resource>
65                                     <directory>../rulemgt/src/main/resources</directory>
66                                     <filtering>false</filtering>
67                                 </resource>
68                             </resources>
69                             <overwrite>true</overwrite>
70                         </configuration>
71                     </execution>
72                     <execution>
73                         <id>copy-resources-${win64id}</id>
74                         <phase>process-resources</phase>
75                         <goals>
76                             <goal>copy-resources</goal>
77                         </goals>
78                         <configuration>
79                             <outputDirectory>${win64outputdir}</outputDirectory>
80                             <resources>
81                                 <resource>
82                                     <directory>src/main/assembly/</directory>
83                                     <filtering>false</filtering>
84                                     <includes>
85                                         <include>**/*</include>
86                                     </includes>
87                                     <excludes>
88                                         <exclude>**/*.sh</exclude>
89                                         <exclude>Dockerfile</exclude>
90                                     </excludes>
91                                 </resource>
92                                 <resource>
93                                     <directory>../rulemgt/src/main/resources</directory>
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-dependency-plugin</artifactId>
125                 <executions>
126                     <execution>
127                         <id>copy-artifacts-${linux64id}</id>
128                         <goals>
129                             <goal>copy</goal>
130                         </goals>
131                         <phase>prepare-package</phase>
132                         <configuration>
133                             <artifactItems>
134                                 <artifactItem>
135                                     <groupId>org.onap.holmes.rule-management</groupId>
136                                     <artifactId>holmes-rulemgt</artifactId>
137                                     <type>jar</type>
138                                     <overWrite>true</overWrite>
139                                     <outputDirectory>${linux64outputdir}</outputDirectory>
140                                     <destFileName>holmes-rulemgt.jar</destFileName>
141                                 </artifactItem>
142                                 <artifactItem>
143                                     <groupId>org.onap.holmes.rule-management</groupId>
144                                     <artifactId>holmes-rulemgt-frontend</artifactId>
145                                     <type>tar.gz</type>
146                                     <overWrite>true</overWrite>
147                                     <outputDirectory>target/version</outputDirectory>
148                                     <destFileName>holmes-rulemgt-frontend-${project.version}.tar.gz</destFileName>
149                                 </artifactItem>
150                             </artifactItems>
151                         </configuration>
152                     </execution>
153                     <execution>
154                         <id>copy-artifacts-${win64id}</id>
155                         <goals>
156                             <goal>copy</goal>
157                         </goals>
158                         <phase>prepare-package</phase>
159                         <configuration>
160                             <artifactItems>
161                                 <artifactItem>
162                                     <groupId>org.onap.holmes.rule-management</groupId>
163                                     <artifactId>holmes-rulemgt</artifactId>
164                                     <type>jar</type>
165                                     <overWrite>true</overWrite>
166                                     <outputDirectory>${win64outputdir}</outputDirectory>
167                                     <destFileName>holmes-rulemgt.jar</destFileName>
168                                 </artifactItem>
169                                 <artifactItem>
170                                     <groupId>org.onap.holmes.rule-management</groupId>
171                                     <artifactId>holmes-rulemgt-frontend</artifactId>
172                                     <type>tar.gz</type>
173                                     <overWrite>true</overWrite>
174                                     <outputDirectory>target/version</outputDirectory>
175                                     <destFileName>holmes-rulemgt-frontend-${project.version}.tar.gz</destFileName>
176                                 </artifactItem>
177                             </artifactItems>
178                         </configuration>
179                     </execution>
180                 </executions>
181             </plugin>
182             <plugin>
183                 <groupId>org.apache.maven.plugins</groupId>
184                 <artifactId>maven-assembly-plugin</artifactId>
185                 <executions>
186                     <execution>
187                         <id>linux64</id>
188                         <configuration>
189                             <descriptors>
190                                 <descriptor>linux64-assembly.xml</descriptor>
191                             </descriptors>
192                             <appendAssemblyId>true</appendAssemblyId>
193                             <outputDirectory>target/version</outputDirectory>
194                         </configuration>
195                         <phase>package</phase>
196                         <goals>
197                             <goal>attached</goal>
198                         </goals>
199                     </execution>
200                     <execution>
201                         <id>win64</id>
202                         <configuration>
203                             <descriptors>
204                                 <descriptor>win64-assembly.xml</descriptor>
205                             </descriptors>
206                             <appendAssemblyId>true</appendAssemblyId>
207                             <outputDirectory>target/version</outputDirectory>
208                         </configuration>
209                         <phase>package</phase>
210                         <goals>
211                             <goal>attached</goal>
212                         </goals>
213                     </execution>
214                 </executions>
215             </plugin>
216             <plugin>
217                 <groupId>org.codehaus.groovy.maven</groupId>
218                 <artifactId>gmaven-plugin</artifactId>
219                 <executions>
220                     <execution>
221                         <phase>validate</phase>
222                         <goals>
223                             <goal>execute</goal>
224                         </goals>
225                         <configuration>
226                             <source>
227                                 println project.properties['holmes.rule.project.version'];
228                                 def versionArray;
229                                 if (project.properties['holmes.rule.project.version'] != null) {
230                                     versionArray = project.properties['holmes.rule.project.version'].split('-');
231                                 }
232
233                                 project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
234
235                                 println 'New Tag for docker:' +
236                                         project.properties['project.docker.latesttag.version'];
237                             </source>
238                         </configuration>
239                     </execution>
240                 </executions>
241             </plugin>
242         </plugins>
243     </build>
244
245     <profiles>
246         <profile>
247             <id>docker</id>
248             <build>
249                 <plugins>
250                     <plugin>
251                         <groupId>io.fabric8</groupId>
252                         <artifactId>docker-maven-plugin</artifactId>
253                         <version>0.16.5</version>
254                         <inherited>false</inherited>
255                         <configuration>
256                             <images>
257                                 <image>
258                                     <name>onap/holmes/rule-management</name>
259                                     <build>
260                                         <cleanup>try</cleanup>
261                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
262                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
263                                         <tags>
264                                             <tag>${project.version}</tag>
265                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
266                                             <tag>${project.docker.latesttag.version}</tag>
267                                         </tags>
268                                     </build>
269                                 </image>
270                             </images>
271                         </configuration>
272                         <executions>
273                             <execution>
274                                 <id>generate-images</id>
275                                 <phase>package</phase>
276                                 <goals>
277                                     <goal>build</goal>
278                                 </goals>
279                             </execution>
280
281                             <execution>
282                                 <id>push-images</id>
283                                 <phase>deploy</phase>
284                                 <goals>
285                                     <goal>build</goal>
286                                     <goal>push</goal>
287                                 </goals>
288                             </execution>
289                         </executions>
290                     </plugin>
291                 </plugins>
292             </build>
293         </profile>
294     </profiles>
295
296     <dependencies>
297         <dependency>
298             <groupId>org.onap.holmes.rule-management</groupId>
299             <artifactId>holmes-rulemgt</artifactId>
300             <version>${project.version}</version>
301         </dependency>
302         <dependency>
303             <groupId>org.onap.holmes.rule-management</groupId>
304             <artifactId>holmes-rulemgt-frontend</artifactId>
305             <version>${project.version}</version>
306             <type>tar.gz</type>
307         </dependency>
308     </dependencies>
309 </project>