Updated the Version of Dropwizard
[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>yyMMdd-HHmmss</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-lib-${linux64id}</id>
74                         <phase>process-resources</phase>
75                         <goals>
76                             <goal>copy-resources</goal>
77                         </goals>
78                         <configuration>
79                             <outputDirectory>${linux64outputdir}/lib</outputDirectory>
80                             <resources>
81                                 <resource>
82                                     <directory>${project.parent.basedir}/rulemgt/target/lib</directory>
83                                     <filtering>false</filtering>
84                                 </resource>
85                             </resources>
86                             <overwrite>true</overwrite>
87                         </configuration>
88                     </execution>
89                     <execution>
90                         <id>copy-resources-${win64id}</id>
91                         <phase>process-resources</phase>
92                         <goals>
93                             <goal>copy-resources</goal>
94                         </goals>
95                         <configuration>
96                             <outputDirectory>${win64outputdir}</outputDirectory>
97                             <resources>
98                                 <resource>
99                                     <directory>src/main/assembly/</directory>
100                                     <filtering>false</filtering>
101                                     <includes>
102                                         <include>**/*</include>
103                                     </includes>
104                                     <excludes>
105                                         <exclude>**/*.sh</exclude>
106                                         <exclude>Dockerfile</exclude>
107                                     </excludes>
108                                 </resource>
109                                 <resource>
110                                     <directory>../rulemgt/src/main/resources</directory>
111                                     <filtering>false</filtering>
112                                 </resource>
113                             </resources>
114                             <overwrite>true</overwrite>
115                         </configuration>
116                     </execution>
117                     <execution>
118                         <id>copy-lib-${win64id}</id>
119                         <phase>process-resources</phase>
120                         <goals>
121                             <goal>copy-resources</goal>
122                         </goals>
123                         <configuration>
124                             <outputDirectory>${win64outputdir}/lib</outputDirectory>
125                             <resources>
126                                 <resource>
127                                     <directory>${project.parent.basedir}/rulemgt/target/lib</directory>
128                                     <filtering>false</filtering>
129                                 </resource>
130                             </resources>
131                             <overwrite>true</overwrite>
132                         </configuration>
133                     </execution>
134                     <execution>
135                         <id>copy-dockerfile</id>
136                         <phase>process-resources</phase>
137                         <goals>
138                             <goal>copy-resources</goal>
139                         </goals>
140                         <configuration>
141                             <outputDirectory>target/version</outputDirectory>
142                             <resources>
143                                 <resource>
144                                     <directory>src/main/assembly/</directory>
145                                     <filtering>false</filtering>
146                                     <includes>
147                                         <include>Dockerfile</include>
148                                     </includes>
149                                 </resource>
150                             </resources>
151                             <overwrite>true</overwrite>
152                         </configuration>
153                     </execution>
154                 </executions>
155             </plugin>
156             <plugin>
157                 <groupId>org.apache.maven.plugins</groupId>
158                 <artifactId>maven-dependency-plugin</artifactId>
159                 <executions>
160                     <execution>
161                         <id>copy-jar-${linux64id}</id>
162                         <goals>
163                             <goal>copy</goal>
164                         </goals>
165                         <phase>prepare-package</phase>
166                         <configuration>
167                             <artifactItems>
168                                 <artifactItem>
169                                     <groupId>org.onap.holmes.rule-management</groupId>
170                                     <artifactId>holmes-rulemgt</artifactId>
171                                     <type>jar</type>
172                                     <overWrite>true</overWrite>
173                                     <outputDirectory>${linux64outputdir}</outputDirectory>
174                                     <destFileName>holmes-rulemgt.jar</destFileName>
175                                 </artifactItem>
176                             </artifactItems>
177                         </configuration>
178                     </execution>
179                     <execution>
180                         <id>copy-jar-${win64id}</id>
181                         <goals>
182                             <goal>copy</goal>
183                         </goals>
184                         <phase>prepare-package</phase>
185                         <configuration>
186                             <artifactItems>
187                                 <artifactItem>
188                                     <groupId>org.onap.holmes.rule-management</groupId>
189                                     <artifactId>holmes-rulemgt</artifactId>
190                                     <type>jar</type>
191                                     <overWrite>true</overWrite>
192                                     <outputDirectory>${win64outputdir}</outputDirectory>
193                                     <destFileName>holmes-rulemgt.jar</destFileName>
194                                 </artifactItem>
195                             </artifactItems>
196                         </configuration>
197                     </execution>
198                 </executions>
199             </plugin>
200             <plugin>
201                 <groupId>org.apache.maven.plugins</groupId>
202                 <artifactId>maven-assembly-plugin</artifactId>
203                 <executions>
204                     <execution>
205                         <id>linux64</id>
206                         <configuration>
207                             <descriptors>
208                                 <descriptor>linux64-assembly.xml</descriptor>
209                             </descriptors>
210                             <appendAssemblyId>true</appendAssemblyId>
211                             <outputDirectory>target/version</outputDirectory>
212                         </configuration>
213                         <phase>package</phase>
214                         <goals>
215                             <goal>attached</goal>
216                         </goals>
217                     </execution>
218                     <execution>
219                         <id>win64</id>
220                         <configuration>
221                             <descriptors>
222                                 <descriptor>win64-assembly.xml</descriptor>
223                             </descriptors>
224                             <appendAssemblyId>true</appendAssemblyId>
225                             <outputDirectory>target/version</outputDirectory>
226                         </configuration>
227                         <phase>package</phase>
228                         <goals>
229                             <goal>attached</goal>
230                         </goals>
231                     </execution>
232                 </executions>
233             </plugin>
234             <plugin>
235                 <groupId>org.codehaus.groovy.maven</groupId>
236                 <artifactId>gmaven-plugin</artifactId>
237                 <executions>
238                     <execution>
239                         <phase>validate</phase>
240                         <goals>
241                             <goal>execute</goal>
242                         </goals>
243                         <configuration>
244                             <source>
245                                 println project.properties['holmes.rule.project.version'];
246                                 def versionArray;
247                                 if ( project.properties['holmes.rule.project.version'] != null ) {
248                                     versionArray = project.properties['holmes.rule.project.version'].split('-');
249                                 }
250
251                                 project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest";
252
253                                 println 'New Tag for docker:' +
254                                 project.properties['project.docker.latesttag.version'];
255                             </source>
256                         </configuration>
257                     </execution>
258                 </executions>
259             </plugin>
260         </plugins>
261     </build>
262
263     <profiles>
264         <profile>
265             <id>docker</id>
266             <build>
267                 <plugins>
268                     <plugin>
269                         <groupId>io.fabric8</groupId>
270                         <artifactId>docker-maven-plugin</artifactId>
271                         <version>0.16.5</version>
272                         <inherited>false</inherited>
273                         <configuration>
274                             <images>
275                                 <image>
276                                     <name>onap/holmes/rule-management</name>
277                                     <build>
278                                         <cleanup>try</cleanup>
279                                         <dockerFileDir>${basedir}/target/version/</dockerFileDir>
280                                         <dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
281                                         <tags>
282                                             <tag>${project.version}</tag>
283                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
284                                             <tag>${project.docker.latesttag.version}</tag>
285                                         </tags>
286                                     </build>
287                                 </image>
288                             </images>
289                         </configuration>
290                         <executions>
291                             <execution>
292                                 <id>generate-images</id>
293                                 <phase>package</phase>
294                                 <goals>
295                                     <goal>build</goal>
296                                 </goals>
297                             </execution>
298
299                             <execution>
300                                 <id>push-images</id>
301                                 <phase>deploy</phase>
302                                 <goals>
303                                     <goal>build</goal>
304                                     <goal>push</goal>
305                                 </goals>
306                             </execution>
307                         </executions>
308                     </plugin>
309                 </plugins>
310             </build>
311         </profile>
312     </profiles>
313
314     <dependencies>
315         <dependency>
316             <groupId>org.onap.holmes.rule-management</groupId>
317             <artifactId>holmes-rulemgt</artifactId>
318             <version>${project.version}</version>
319         </dependency>
320     </dependencies>
321 </project>