Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | ~ Copyright 2018-present Open Networking Foundation |
| 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 | |
| 19 | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| 20 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 22 | <parent> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 23 | <artifactId>onos-protocols-bmv2</artifactId> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 24 | <groupId>org.onosproject</groupId> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 25 | <version>1.14.0-SNAPSHOT</version> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 26 | </parent> |
| 27 | |
| 28 | <modelVersion>4.0.0</modelVersion> |
| 29 | |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 30 | <artifactId>onos-protocols-bmv2-thrift-api</artifactId> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 31 | |
| 32 | <packaging>bundle</packaging> |
| 33 | |
| 34 | <properties> |
| 35 | <!-- BMv2 Commit ID and Thrift version --> |
Carmelo Cascone | f645e84 | 2018-07-16 18:31:52 +0200 | [diff] [blame] | 36 | <bmv2.commit>a3f0ebe4c0f10a656f8aa1ad68cb20402a62b0ee</bmv2.commit> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 37 | <bmv2.thrift.version>0.9.3</bmv2.thrift.version> |
| 38 | <bmv2.baseurl>https://cdn.rawgit.com/opennetworkinglab/onos-bmv2/${bmv2.commit}</bmv2.baseurl> |
| 39 | <bmv2.thrift.javanamespace>org.onosproject.bmv2.thriftapi</bmv2.thrift.javanamespace> |
| 40 | <bmv2.thrift.srcdir>${project.build.directory}/thrift-sources/${bmv2.commit}/</bmv2.thrift.srcdir> |
| 41 | <thrift.exedir>${project.build.directory}/thrift-compiler/</thrift.exedir> |
| 42 | <thrift.exefilename>thrift-${os.detected.classifier}.exe</thrift.exefilename> |
| 43 | </properties> |
| 44 | |
| 45 | <dependencies> |
| 46 | <dependency> |
| 47 | <groupId>org.apache.thrift</groupId> |
| 48 | <artifactId>libthrift</artifactId> |
| 49 | <version>0.9.3</version> |
| 50 | </dependency> |
| 51 | </dependencies> |
| 52 | |
| 53 | <repositories> |
| 54 | <!-- Needed for thrift-compiler, which is hosted on GitHub --> |
| 55 | <repository> |
| 56 | <id>jitpack.io</id> |
| 57 | <url>https://jitpack.io</url> |
| 58 | </repository> |
| 59 | </repositories> |
| 60 | |
| 61 | <build> |
| 62 | <extensions> |
| 63 | <extension> |
| 64 | <groupId>kr.motd.maven</groupId> |
| 65 | <artifactId>os-maven-plugin</artifactId> |
| 66 | <version>1.4.0.Final</version> |
| 67 | </extension> |
| 68 | </extensions> |
| 69 | |
| 70 | <plugins> |
| 71 | <!-- Download Thrift source files from BMv2 Github repo --> |
| 72 | <plugin> |
| 73 | <groupId>com.googlecode.maven-download-plugin</groupId> |
| 74 | <artifactId>download-maven-plugin</artifactId> |
| 75 | <version>1.3.0</version> |
| 76 | <executions> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 77 | <!-- |
| 78 | <execution> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 79 | <id>download-bmv2-thrift-standard</id> |
| 80 | <phase>initialize</phase> |
| 81 | <goals> |
| 82 | <goal>wget</goal> |
| 83 | </goals> |
| 84 | <configuration> |
| 85 | <url>${bmv2.baseurl}/thrift_src/standard.thrift</url> |
| 86 | <outputDirectory>${bmv2.thrift.srcdir}</outputDirectory> |
| 87 | </configuration> |
| 88 | </execution> |
| 89 | <execution> |
| 90 | <id>download-bmv2-thrift-simple_pre</id> |
| 91 | <phase>initialize</phase> |
| 92 | <goals> |
| 93 | <goal>wget</goal> |
| 94 | </goals> |
| 95 | <configuration> |
| 96 | <url>${bmv2.baseurl}/thrift_src/simple_pre.thrift</url> |
| 97 | <outputDirectory>${bmv2.thrift.srcdir}</outputDirectory> |
| 98 | </configuration> |
| 99 | </execution> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 100 | --> |
| 101 | <execution> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 102 | <id>download-bmv2-thrift-simple_pre_lag</id> |
| 103 | <phase>initialize</phase> |
| 104 | <goals> |
| 105 | <goal>wget</goal> |
| 106 | </goals> |
| 107 | <configuration> |
| 108 | <url>${bmv2.baseurl}/thrift_src/simple_pre_lag.thrift</url> |
| 109 | <outputDirectory>${bmv2.thrift.srcdir}</outputDirectory> |
| 110 | </configuration> |
| 111 | </execution> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 112 | <!-- |
| 113 | <execution> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 114 | <id>download-bmv2-thrift-simple_switch</id> |
| 115 | <phase>initialize</phase> |
| 116 | <goals> |
| 117 | <goal>wget</goal> |
| 118 | </goals> |
| 119 | <configuration> |
| 120 | <url>${bmv2.baseurl}/targets/simple_switch/thrift/simple_switch.thrift</url> |
| 121 | <outputDirectory>${bmv2.thrift.srcdir}</outputDirectory> |
| 122 | </configuration> |
| 123 | </execution> |
| 124 | <execution> |
| 125 | <id>download-bmv2-thrift-simple_switch-cpservice</id> |
| 126 | <phase>initialize</phase> |
| 127 | <goals> |
| 128 | <goal>wget</goal> |
| 129 | </goals> |
| 130 | <configuration> |
| 131 | <url>${bmv2.baseurl}/targets/simple_switch/thrift/control_plane.thrift</url> |
| 132 | <outputDirectory>${bmv2.thrift.srcdir}</outputDirectory> |
| 133 | </configuration> |
| 134 | </execution> |
Yuta HIGUCHI | cf91a2d | 2018-07-03 14:26:13 +0900 | [diff] [blame] | 135 | --> |
| 136 | </executions> |
Esin Karaman | 971fb7f | 2017-12-28 13:44:52 +0000 | [diff] [blame] | 137 | </plugin> |
| 138 | <!-- Extract Thrift compiler --> |
| 139 | <plugin> |
| 140 | <groupId>org.apache.maven.plugins</groupId> |
| 141 | <artifactId>maven-dependency-plugin</artifactId> |
| 142 | <executions> |
| 143 | <execution> |
| 144 | <id>unpack</id> |
| 145 | <phase>initialize</phase> |
| 146 | <goals> |
| 147 | <goal>unpack</goal> |
| 148 | </goals> |
| 149 | <configuration> |
| 150 | <artifactItems> |
| 151 | <artifactItem> |
| 152 | <groupId>com.github.ccascone</groupId> |
| 153 | <artifactId>mvn-thrift-compiler</artifactId> |
| 154 | <version>1.1_${bmv2.thrift.version}</version> |
| 155 | <type>jar</type> |
| 156 | <includes>${thrift.exefilename}</includes> |
| 157 | <outputDirectory>${project.build.directory}/thrift-compiler</outputDirectory> |
| 158 | </artifactItem> |
| 159 | </artifactItems> |
| 160 | </configuration> |
| 161 | </execution> |
| 162 | </executions> |
| 163 | </plugin> |
| 164 | <!-- Add missing java namespace to Thrift files --> |
| 165 | <plugin> |
| 166 | <groupId>org.codehaus.mojo</groupId> |
| 167 | <artifactId>exec-maven-plugin</artifactId> |
| 168 | <version>1.4.0</version> |
| 169 | <executions> |
| 170 | <execution> |
| 171 | <id>add-bmv2-thrift-java-namespace</id> |
| 172 | <phase>initialize</phase> |
| 173 | <goals> |
| 174 | <goal>exec</goal> |
| 175 | </goals> |
| 176 | <configuration> |
| 177 | <executable>${project.basedir}/src/patch.sh</executable> |
| 178 | <arguments> |
| 179 | <argument>${bmv2.thrift.srcdir}</argument> |
| 180 | <argument>${bmv2.thrift.javanamespace}</argument> |
| 181 | </arguments> |
| 182 | </configuration> |
| 183 | </execution> |
| 184 | <execution> |
| 185 | <id>set-thrift-compiler-permissions</id> |
| 186 | <phase>initialize</phase> |
| 187 | <goals> |
| 188 | <goal>exec</goal> |
| 189 | </goals> |
| 190 | <configuration> |
| 191 | <executable>chmod</executable> |
| 192 | <arguments> |
| 193 | <argument>+x</argument> |
| 194 | <argument>${thrift.exedir}/${thrift.exefilename}</argument> |
| 195 | </arguments> |
| 196 | </configuration> |
| 197 | </execution> |
| 198 | </executions> |
| 199 | </plugin> |
| 200 | <!-- Compile Thrift files --> |
| 201 | <plugin> |
| 202 | <groupId>org.apache.thrift.tools</groupId> |
| 203 | <artifactId>maven-thrift-plugin</artifactId> |
| 204 | <version>0.1.11</version> |
| 205 | <configuration> |
| 206 | <thriftSourceRoot>${bmv2.thrift.srcdir}</thriftSourceRoot> |
| 207 | <thriftExecutable>${thrift.exedir}/${thrift.exefilename}</thriftExecutable> |
| 208 | <outputDirectory>${project.build.directory}/generated-sources</outputDirectory> |
| 209 | </configuration> |
| 210 | <executions> |
| 211 | <execution> |
| 212 | <id>thrift-sources</id> |
| 213 | <phase>initialize</phase> |
| 214 | <goals> |
| 215 | <goal>compile</goal> |
| 216 | </goals> |
| 217 | </execution> |
| 218 | </executions> |
| 219 | </plugin> |
| 220 | <!-- Make generated sources visible --> |
| 221 | <plugin> |
| 222 | <groupId>org.codehaus.mojo</groupId> |
| 223 | <artifactId>build-helper-maven-plugin</artifactId> |
| 224 | <version>1.4</version> |
| 225 | <executions> |
| 226 | <execution> |
| 227 | <id>add-thrift-sources-to-path</id> |
| 228 | <phase>generate-sources</phase> |
| 229 | <goals> |
| 230 | <goal>add-source</goal> |
| 231 | </goals> |
| 232 | <configuration> |
| 233 | <sources> |
| 234 | <source> |
| 235 | ${project.build.directory}/generated-sources |
| 236 | </source> |
| 237 | </sources> |
| 238 | </configuration> |
| 239 | </execution> |
| 240 | </executions> |
| 241 | </plugin> |
| 242 | </plugins> |
| 243 | </build> |
Carmelo Cascone | f645e84 | 2018-07-16 18:31:52 +0200 | [diff] [blame] | 244 | </project> |