blob: 9de65fd0e572b98b0372c2cc2cf20f6d125863bf [file] [log] [blame]
Dan Timoneye50df7d2017-08-10 16:59:02 -04001<?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-root</artifactId>
Dan Timoney24a1a1b2017-08-21 10:27:47 -04008 <version>0.1.0-SNAPSHOT</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -04009 </parent>
10
11 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
13 <artifactId>distribution-opendaylight</artifactId>
Dan Timoney24a1a1b2017-08-21 10:27:47 -040014 <version>0.1.0-SNAPSHOT</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -040015
16 <name>Distribution - opendaylight</name>
17 <description>Creates OpenDaylight container</description>
18
19 <properties>
20 <image.name>onap/ccsdk-odl-image</image.name>
21 <ccsdk.project.version>${project.version}</ccsdk.project.version>
22 <ccsdk.opendaylight.version>0.6.1-Carbon</ccsdk.opendaylight.version>
23 <ccsdk.mysql-connector-java.version>5.1.39</ccsdk.mysql-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>distribution-karaf</artifactId>
32 <version>${ccsdk.opendaylight.version}</version>
33 <type>tar.gz</type>
34 </dependency>
35 <dependency>
36 <groupId>mysql</groupId>
37 <artifactId>mysql-connector-java</artifactId>
38 <version>${ccsdk.mysql-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 =
63 project.properties['ccsdk.project.version'].split('\\.');
64 }
65
66 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) {
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:' +
73 project.properties['project.docker.latesttag.version'];
74 </source>
75 </configuration>
76 </execution>
77 </executions>
78 </plugin>
79
80 <plugin>
81 <groupId>io.fabric8</groupId>
82 <artifactId>docker-maven-plugin</artifactId>
83 <version>0.16.5</version>
84 <inherited>false</inherited>
85 <configuration>
86 <images>
87 <image>
88 <name>${image.name}</name>
89 <build>
90 <cleanup>try</cleanup>
91 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
92 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
93 <tags>
94 <tag>${project.version}</tag>
95 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
96 <tag>${project.docker.latesttag.version}</tag>
97 </tags>
98 </build>
99 </image>
100 </images>
101 </configuration>
102 <executions>
103 <execution>
104 <id>generate-images</id>
105 <phase>package</phase>
106 <goals>
107 <goal>build</goal>
108 </goals>
109 </execution>
110
111 <execution>
112 <id>push-images</id>
113 <phase>deploy</phase>
114 <goals>
115 <goal>build</goal>
116 <goal>push</goal>
117 </goals>
118 </execution>
119 </executions>
120 </plugin>
121
122
123 <plugin>
124 <groupId>org.apache.maven.plugins</groupId>
125 <artifactId>maven-dependency-plugin</artifactId>
126 <version>3.0.0</version>
127 <executions>
128 <execution>
129 <id>get-odl-distribution</id>
130 <phase>validate</phase>
131 <goals>
132 <goal>copy</goal>
133 </goals>
134 <configuration>
135 <artifactItems>
136 <artifactItem>
137 <groupId>org.opendaylight.integration</groupId>
138 <artifactId>distribution-karaf</artifactId>
139 <version>${ccsdk.opendaylight.version}</version>
140 <type>tar.gz</type>
141
142 <overWrite>true</overWrite>
143 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
144 </artifactItem>
145 </artifactItems>
146 <overWriteReleases>false</overWriteReleases>
147 <overWriteSnapshots>true</overWriteSnapshots>
148 <overWriteIfNewer>true</overWriteIfNewer>
149 </configuration>
150 </execution>
151 </executions>
152 </plugin>
153
154 <plugin>
155 <groupId>org.apache.maven.plugins</groupId>
156 <artifactId>maven-dependency-plugin</artifactId>
157 <version>3.0.0</version>
158 <executions>
159 <execution>
160 <id>get-mysql-connector-jar</id>
161 <phase>validate</phase>
162 <goals>
163 <goal>copy</goal>
164 </goals>
165 <configuration>
166 <artifactItems>
167 <artifactItem>
168 <groupId>mysql</groupId>
169 <artifactId>mysql-connector-java</artifactId>
170 <version>${ccsdk.mysql-connector-java.version}</version>
171 <type>jar</type>
172
173 <overWrite>true</overWrite>
174 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
175 </artifactItem>
176 </artifactItems>
177 <overWriteReleases>false</overWriteReleases>
178 <overWriteSnapshots>true</overWriteSnapshots>
179 <overWriteIfNewer>true</overWriteIfNewer>
180 </configuration>
181 </execution>
182 </executions>
183 </plugin>
184
185 <plugin>
186 <artifactId>maven-resources-plugin</artifactId>
187 <version>2.6</version>
188 <executions>
189 <execution>
190 <id>copy-dockerfile</id>
191 <goals>
192 <goal>copy-resources</goal>
193 </goals><!-- here the phase you need -->
194 <phase>validate</phase>
195 <configuration>
196 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
197 <resources>
198 <resource>
199 <directory>src/main/docker</directory>
200 <includes>
201 <include>Dockerfile</include>
202 </includes>
203 <filtering>true</filtering>
204 </resource>
205 </resources>
206 </configuration>
207 </execution>
208 </executions>
209 </plugin>
210
211
212
213 </plugins>
214
215 </build>
216 <organization>
217 <name>openECOMP</name>
218 </organization>
219</project>