Fix karaf tarball name
[ccsdk/distribution.git] / opendaylight / nitrogen / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
5     <parent>
6         <groupId>org.onap.ccsdk.distribution</groupId>
7         <artifactId>distribution-opendaylight</artifactId>
8         <version>0.2.0-SNAPSHOT</version>
9     </parent>
10
11     <modelVersion>4.0.0</modelVersion>
12     <packaging>pom</packaging>
13     <artifactId>distribution-odl-nitrogen</artifactId>
14     <version>0.2.0-SNAPSHOT</version>
15
16     <name>Distribution - opendaylight</name>
17     <description>Creates OpenDaylight container</description>
18
19     <properties>
20         <image.name>onap/ccsdk-odl-nitrogen-image</image.name>
21         <ccsdk.project.version>${project.version}</ccsdk.project.version>
22         <ccsdk.opendaylight.version>0.7.1</ccsdk.opendaylight.version>
23         <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
24         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
25     </properties>
26
27     <dependencyManagement>
28         <dependencies>
29             <dependency>
30                 <groupId>org.opendaylight.integration</groupId>
31                 <artifactId>karaf</artifactId>
32                 <version>${ccsdk.opendaylight.version}</version>
33                 <type>tar.gz</type>
34             </dependency>
35             <dependency>
36                 <groupId>org.mariadb.jdbc</groupId>
37                 <artifactId>mariadb-java-client</artifactId>
38                 <version>${ccsdk.mariadb-connector-java.version}</version>
39                 <type>jar</type>
40             </dependency>
41         </dependencies>
42     </dependencyManagement>
43
44     <build>
45         <plugins>
46
47
48             <plugin>
49                 <groupId>org.codehaus.groovy.maven</groupId>
50                 <artifactId>gmaven-plugin</artifactId>
51                 <executions>
52                     <execution>
53                         <phase>validate</phase>
54                         <goals>
55                             <goal>execute</goal>
56                         </goals>
57                         <configuration>
58                             <source>
59                                 println project.properties['ccsdk.project.version'];
60                                 def versionArray;
61                                 if (project.properties['ccsdk.project.version'] != null ) {
62                                 versionArray = project.properties['ccsdk.project.version'].split('\\.');
63                                 }
64
65                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
66                                 {
67                                 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
68                                 } else {
69                                 project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
70                                 }
71
72                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
73                             </source>
74                         </configuration>
75                     </execution>
76                 </executions>
77             </plugin>
78
79
80
81             <plugin>
82                 <groupId>org.apache.maven.plugins</groupId>
83                 <artifactId>maven-dependency-plugin</artifactId>
84                 <version>3.0.0</version>
85                 <executions>
86                     <execution>
87                         <id>get-odl-distribution</id>
88                         <phase>validate</phase>
89                         <goals>
90                             <goal>copy</goal>
91                         </goals>
92                         <configuration>
93                             <artifactItems>
94                                 <artifactItem>
95                                     <groupId>org.opendaylight.integration</groupId>
96                                     <artifactId>karaf</artifactId>
97                                     <version>${ccsdk.opendaylight.version}</version>
98                                     <type>tar.gz</type>
99
100                                     <overWrite>true</overWrite>
101                                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
102                                 </artifactItem>
103                             </artifactItems>
104                             <overWriteReleases>false</overWriteReleases>
105                             <overWriteSnapshots>true</overWriteSnapshots>
106                             <overWriteIfNewer>true</overWriteIfNewer>
107                         </configuration>
108                     </execution>
109
110                     <execution>
111                         <id>get-mariadb-connector-jar</id>
112                         <phase>validate</phase>
113                         <goals>
114                             <goal>copy</goal>
115                         </goals>
116                         <configuration>
117                             <artifactItems>
118                                 <artifactItem>
119                                     <groupId>org.mariadb.jdbc</groupId>
120                                     <artifactId>mariadb-java-client</artifactId>
121                                     <version>${ccsdk.mariadb-connector-java.version}</version>
122                                     <type>jar</type>
123                                     <overWrite>true</overWrite>
124                                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
125                                 </artifactItem>
126                             </artifactItems>
127                             <overWriteReleases>false</overWriteReleases>
128                             <overWriteSnapshots>true</overWriteSnapshots>
129                             <overWriteIfNewer>true</overWriteIfNewer>
130                         </configuration>
131                     </execution>
132                 </executions>
133             </plugin>
134
135             <plugin>
136                 <artifactId>maven-resources-plugin</artifactId>
137                 <version>2.6</version>
138                 <executions>
139                     <execution>
140                         <id>copy-dockerfile</id>
141                         <goals>
142                             <goal>copy-resources</goal>
143                         </goals><!-- here the phase you need -->
144                         <phase>validate</phase>
145                         <configuration>
146                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
147                             <resources>
148                                 <resource>
149                                     <directory>src/main/docker</directory>
150                                     <includes>
151                                         <include>Dockerfile</include>
152                                     </includes>
153                                     <filtering>true</filtering>
154                                 </resource>
155                             </resources>
156                         </configuration>
157                     </execution>
158                 </executions>
159             </plugin>
160
161
162
163         </plugins>
164
165     </build>
166
167     <profiles>
168         <profile>
169             <id>docker</id>
170             <build>
171                 <plugins>
172                     <plugin>
173                         <groupId>io.fabric8</groupId>
174                         <artifactId>docker-maven-plugin</artifactId>
175                         <version>0.16.5</version>
176                         <inherited>false</inherited>
177                         <configuration>
178                             <images>
179                                 <image>
180                                     <name>${image.name}</name>
181                                     <build>
182                                         <cleanup>try</cleanup>
183                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
184                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
185                                         <tags>
186                                             <tag>${project.version}</tag>
187                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
188                                             <tag>${project.docker.latesttag.version}</tag>
189                                         </tags>
190                                     </build>
191                                 </image>
192                             </images>
193                         </configuration>
194                         <executions>
195                             <execution>
196                                 <id>generate-images</id>
197                                 <phase>package</phase>
198                                 <goals>
199                                     <goal>build</goal>
200                                 </goals>
201                             </execution>
202
203                             <execution>
204                                 <id>push-images</id>
205                                 <phase>deploy</phase>
206                                 <goals>
207                                     <goal>build</goal>
208                                     <goal>push</goal>
209                                 </goals>
210                             </execution>
211                         </executions>
212                     </plugin>
213
214                 </plugins>
215             </build>
216         </profile>
217
218     </profiles>
219     <organization>
220         <name>ONAP</name>
221     </organization>
222 </project>