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