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