blob: 1a67c76b2f0f365b2ec0338de21eca54d39a3c9d [file] [log] [blame]
Carmelo Cascone2ea177b2016-02-25 18:38:42 -08001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 ~ Copyright 2014-2016 Open Networking Laboratory
4 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License.
7 ~ You may obtain a copy of the License at
8 ~
9 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~
11 ~ Unless required by applicable law or agreed to in writing, software
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License.
16 -->
17
18<project xmlns="http://maven.apache.org/POM/4.0.0"
19 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 <parent>
22 <artifactId>onos-protocols</artifactId>
23 <groupId>org.onosproject</groupId>
24 <version>1.6.0-SNAPSHOT</version>
25 </parent>
26 <modelVersion>4.0.0</modelVersion>
27
28 <artifactId>onos-bmv2-protocol</artifactId>
29 <version>1.6.0-SNAPSHOT</version>
30
31 <packaging>bundle</packaging>
32
33 <description>BMv2 protocol subsystem</description>
34
35 <properties>
36 <!-- BMv2 Commit ID and Thrift version -->
Carmelo Casconee4da9092016-04-26 12:14:08 -070037 <bmv2.commit>4421bafd6d26740b0bbf802c2e9f9f54c1211b13</bmv2.commit>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -080038 <bmv2.thrift.version>0.9.3</bmv2.thrift.version>
39 <!-- Do not change below -->
40 <bmv2.baseurl>
Carmelo Casconee4da9092016-04-26 12:14:08 -070041 https://raw.githubusercontent.com/ccascone/behavioral-model/${bmv2.commit}
Carmelo Cascone2ea177b2016-02-25 18:38:42 -080042 </bmv2.baseurl>
43 <bmv2.thrift.srcdir>${project.basedir}/src/main/thrift</bmv2.thrift.srcdir>
44 <thrift.path>${project.build.directory}/thrift-compiler/</thrift.path>
45 <thrift.filename>thrift-${os.detected.classifier}.exe</thrift.filename>
46 </properties>
47
48 <dependencies>
49 <dependency>
50 <groupId>org.apache.thrift</groupId>
51 <artifactId>libthrift</artifactId>
52 <version>${bmv2.thrift.version}</version>
53 </dependency>
54 <dependency>
55 <groupId>org.onosproject</groupId>
56 <artifactId>onos-api</artifactId>
57 <version>${project.version}</version>
58 </dependency>
Carmelo Casconee4da9092016-04-26 12:14:08 -070059 <dependency>
60 <groupId>org.apache.felix</groupId>
61 <artifactId>org.apache.felix.scr.annotations</artifactId>
62 </dependency>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -080063 </dependencies>
64
65 <repositories>
66 <!-- Needed for thrift-compiler, which is hosted on GitHub -->
67 <repository>
68 <id>jitpack.io</id>
69 <url>https://jitpack.io</url>
70 </repository>
71 </repositories>
72
73 <build>
74 <extensions>
75 <extension>
76 <groupId>kr.motd.maven</groupId>
77 <artifactId>os-maven-plugin</artifactId>
78 <version>1.4.0.Final</version>
79 </extension>
80 </extensions>
81
82 <plugins>
83 <!-- Download Thrift source files from BMv2 Github repo -->
84 <plugin>
85 <groupId>org.codehaus.mojo</groupId>
86 <artifactId>wagon-maven-plugin</artifactId>
87 <version>1.0</version>
88 <executions>
89 <execution>
90 <id>download-bmv2-thrift-standard</id>
Carmelo Casconee4da9092016-04-26 12:14:08 -070091 <phase>initialize</phase>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -080092 <goals>
93 <goal>download-single</goal>
94 </goals>
95 <configuration>
96 <url>${bmv2.baseurl}</url>
97 <fromFile>thrift_src/standard.thrift</fromFile>
98 <toDir>${bmv2.thrift.srcdir}</toDir>
99 </configuration>
100 </execution>
101 <execution>
102 <id>download-bmv2-thrift-simple_pre</id>
103 <phase>initialize</phase>
104 <goals>
105 <goal>download-single</goal>
106 </goals>
107 <configuration>
108 <url>${bmv2.baseurl}</url>
109 <fromFile>thrift_src/simple_pre.thrift</fromFile>
110 <toDir>${bmv2.thrift.srcdir}</toDir>
111 </configuration>
112 </execution>
113 <execution>
114 <id>download-bmv2-thrift-simple_pre_lag</id>
115 <phase>initialize</phase>
116 <goals>
117 <goal>download-single</goal>
118 </goals>
119 <configuration>
120 <url>${bmv2.baseurl}</url>
121 <fromFile>thrift_src/simple_pre_lag.thrift
122 </fromFile>
123 <toDir>${bmv2.thrift.srcdir}</toDir>
124 </configuration>
125 </execution>
126 <execution>
127 <id>download-bmv2-thrift-simple_switch</id>
128 <phase>initialize</phase>
129 <goals>
130 <goal>download-single</goal>
131 </goals>
132 <configuration>
133 <url>${bmv2.baseurl}</url>
134 <fromFile>
135 targets/simple_switch/thrift/simple_switch.thrift
136 </fromFile>
137 <toDir>${bmv2.thrift.srcdir}</toDir>
138 </configuration>
139 </execution>
Carmelo Casconee4da9092016-04-26 12:14:08 -0700140 <execution>
141 <id>download-bmv2-thrift-simple_switch-cpservice</id>
142 <phase>initialize</phase>
143 <goals>
144 <goal>download-single</goal>
145 </goals>
146 <configuration>
147 <url>${bmv2.baseurl}</url>
148 <fromFile>
149 targets/simple_switch/thrift/control_plane.thrift
150 </fromFile>
151 <toDir>${bmv2.thrift.srcdir}</toDir>
152 </configuration>
153 </execution>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -0800154 </executions>
155 </plugin>
156 <!-- Extract Thrift compiler -->
157 <plugin>
158 <groupId>org.apache.maven.plugins</groupId>
159 <artifactId>maven-dependency-plugin</artifactId>
160 <executions>
161 <execution>
162 <id>unpack</id>
163 <phase>initialize</phase>
164 <goals>
165 <goal>unpack</goal>
166 </goals>
167 <configuration>
168 <artifactItems>
169 <artifactItem>
170 <groupId>com.github.ccascone</groupId>
171 <artifactId>mvn-thrift-compiler</artifactId>
172 <version>1.1_${bmv2.thrift.version}</version>
173 <type>jar</type>
174 <includes>${thrift.filename}</includes>
175 <outputDirectory>${project.build.directory}/thrift-compiler</outputDirectory>
176 </artifactItem>
177 </artifactItems>
178 </configuration>
179 </execution>
180 </executions>
181 </plugin>
182 <!-- Add missing java namespace to Thrift files -->
183 <plugin>
184 <groupId>org.codehaus.mojo</groupId>
185 <artifactId>exec-maven-plugin</artifactId>
186 <version>1.4.0</version>
187 <executions>
188 <execution>
189 <id>add-bmv2-thrift-java-namespace</id>
190 <phase>initialize</phase>
191 <goals>
192 <goal>exec</goal>
193 </goals>
194 <configuration>
195 <executable>${bmv2.thrift.srcdir}/patch.sh
196 </executable>
197 </configuration>
198 </execution>
199 <execution>
200 <id>set-thrift-compiler-permissions</id>
201 <phase>initialize</phase>
202 <goals>
203 <goal>exec</goal>
204 </goals>
205 <configuration>
206 <executable>chmod</executable>
207 <arguments>
208 <argument>+x</argument>
209 <argument>${thrift.path}/${thrift.filename}</argument>
210 </arguments>
211 </configuration>
212 </execution>
213 </executions>
214 </plugin>
215 <!-- Compile Thrift files -->
216 <plugin>
217 <groupId>org.apache.thrift.tools</groupId>
218 <artifactId>maven-thrift-plugin</artifactId>
219 <version>0.1.11</version>
220 <configuration>
221 <thriftExecutable>${thrift.path}/${thrift.filename}</thriftExecutable>
Carmelo Casconee4da9092016-04-26 12:14:08 -0700222 <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -0800223 </configuration>
224 <executions>
225 <execution>
226 <id>thrift-sources</id>
Carmelo Casconee4da9092016-04-26 12:14:08 -0700227 <phase>initialize</phase>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -0800228 <goals>
229 <goal>compile</goal>
230 </goals>
231 </execution>
232 </executions>
233 </plugin>
234 <!-- Make generated sources visible -->
235 <plugin>
236 <groupId>org.codehaus.mojo</groupId>
237 <artifactId>build-helper-maven-plugin</artifactId>
238 <version>1.4</version>
239 <executions>
240 <execution>
241 <id>add-thrift-sources-to-path</id>
242 <phase>generate-sources</phase>
243 <goals>
244 <goal>add-source</goal>
245 </goals>
246 <configuration>
247 <sources>
248 <source>
Carmelo Casconee4da9092016-04-26 12:14:08 -0700249 ${project.build.directory}/generated-sources
Carmelo Cascone2ea177b2016-02-25 18:38:42 -0800250 </source>
251 </sources>
252 </configuration>
253 </execution>
254 </executions>
255 </plugin>
Carmelo Casconee4da9092016-04-26 12:14:08 -0700256 <!-- OSGi -->
257 <plugin>
258 <groupId>org.apache.felix</groupId>
259 <artifactId>maven-scr-plugin</artifactId>
260 </plugin>
261 <plugin>
262 <groupId>org.onosproject</groupId>
263 <artifactId>onos-maven-plugin</artifactId>
264 </plugin>
Carmelo Cascone2ea177b2016-02-25 18:38:42 -0800265 </plugins>
266 </build>
267
268</project>