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

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use