netty-transport-native-epoll-4.1.27.Final.pom 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2014 The Netty Project
  4. ~
  5. ~ The Netty Project licenses this file to you under the Apache License,
  6. ~ version 2.0 (the "License"); you may not use this file except in compliance
  7. ~ with the License. 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, WITHOUT
  13. ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. ~ License for the specific language governing permissions and limitations
  15. ~ under the License.
  16. -->
  17. <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/maven-v4_0_0.xsd">
  18. <modelVersion>4.0.0</modelVersion>
  19. <parent>
  20. <groupId>io.netty</groupId>
  21. <artifactId>netty-parent</artifactId>
  22. <version>4.1.27.Final</version>
  23. </parent>
  24. <artifactId>netty-transport-native-epoll</artifactId>
  25. <name>Netty/Transport/Native/Epoll</name>
  26. <packaging>jar</packaging>
  27. <properties>
  28. <javaModuleName>io.netty.transport.epoll</javaModuleName>
  29. <!-- Needed by the native transport as we need the memoryAddress of the ByteBuffer -->
  30. <argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED</argLine.java9.extras>
  31. <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
  32. <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
  33. <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
  34. <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
  35. <jni.compiler.args.ldflags>LDFLAGS=-L${unix.common.lib.unpacked.dir} -Wl,--no-as-needed -lrt -Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive</jni.compiler.args.ldflags>
  36. <skipTests>true</skipTests>
  37. </properties>
  38. <profiles>
  39. <!--
  40. Netty must be released from RHEL 6.8 x86_64 or compatible so that:
  41. 1) we ship x86_64 version of epoll transport officially, and
  42. 2) we ensure the ABI compatibility with older GLIBC versions.
  43. The shared library built on a distribution with newer GLIBC
  44. will not run on older distributions.
  45. -->
  46. <profile>
  47. <id>restricted-release-epoll</id>
  48. <build>
  49. <pluginManagement>
  50. <plugins>
  51. <plugin>
  52. <artifactId>maven-enforcer-plugin</artifactId>
  53. <version>1.4.1</version>
  54. <dependencies>
  55. <!-- Provides the 'requireFilesContent' enforcer rule. -->
  56. <dependency>
  57. <groupId>com.ceilfors.maven.plugin</groupId>
  58. <artifactId>enforcer-rules</artifactId>
  59. <version>1.2.0</version>
  60. </dependency>
  61. </dependencies>
  62. </plugin>
  63. </plugins>
  64. </pluginManagement>
  65. <plugins>
  66. <plugin>
  67. <artifactId>maven-enforcer-plugin</artifactId>
  68. <executions>
  69. <execution>
  70. <id>enforce-release-environment</id>
  71. <goals>
  72. <goal>enforce</goal>
  73. </goals>
  74. <configuration>
  75. <rules>
  76. <requireProperty>
  77. <regexMessage>
  78. Release process must be performed on linux-x86_64.
  79. </regexMessage>
  80. <property>os.detected.classifier</property>
  81. <regex>^linux-x86_64$</regex>
  82. </requireProperty>
  83. <requireFilesContent>
  84. <message>
  85. Release process must be performed on RHEL 6.8 or its derivatives.
  86. </message>
  87. <files>
  88. <file>/etc/redhat-release</file>
  89. </files>
  90. <content>release 6.9</content>
  91. </requireFilesContent>
  92. </rules>
  93. </configuration>
  94. </execution>
  95. </executions>
  96. </plugin>
  97. </plugins>
  98. </build>
  99. </profile>
  100. <profile>
  101. <id>linux</id>
  102. <activation>
  103. <os>
  104. <family>linux</family>
  105. </os>
  106. </activation>
  107. <properties>
  108. <skipTests>false</skipTests>
  109. </properties>
  110. <build>
  111. <plugins>
  112. <plugin>
  113. <artifactId>maven-dependency-plugin</artifactId>
  114. <executions>
  115. <!-- unpack the unix-common static library and include files -->
  116. <execution>
  117. <id>unpack</id>
  118. <phase>generate-sources</phase>
  119. <goals>
  120. <goal>unpack-dependencies</goal>
  121. </goals>
  122. <configuration>
  123. <includeGroupIds>${project.groupId}</includeGroupIds>
  124. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  125. <classifier>${jni.classifier}</classifier>
  126. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  127. <includes>META-INF/native/**</includes>
  128. <overWriteReleases>false</overWriteReleases>
  129. <overWriteSnapshots>true</overWriteSnapshots>
  130. </configuration>
  131. </execution>
  132. </executions>
  133. </plugin>
  134. <plugin>
  135. <groupId>org.fusesource.hawtjni</groupId>
  136. <artifactId>maven-hawtjni-plugin</artifactId>
  137. <executions>
  138. <execution>
  139. <id>build-native-lib</id>
  140. <configuration>
  141. <name>netty_transport_native_epoll_${os.detected.arch}</name>
  142. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  143. <libDirectory>${project.build.outputDirectory}</libDirectory>
  144. <!-- We use Maven's artifact classifier instead.
  145. This hack will make the hawtjni plugin to put the native library
  146. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  147. <platform>.</platform>
  148. <configureArgs>
  149. <arg>${jni.compiler.args.ldflags}</arg>
  150. <arg>${jni.compiler.args.cflags}</arg>
  151. </configureArgs>
  152. </configuration>
  153. <goals>
  154. <goal>generate</goal>
  155. <goal>build</goal>
  156. </goals>
  157. <phase>compile</phase>
  158. </execution>
  159. </executions>
  160. </plugin>
  161. <plugin>
  162. <artifactId>maven-jar-plugin</artifactId>
  163. <executions>
  164. <!-- Generate the JAR that contains the native library in it. -->
  165. <execution>
  166. <id>native-jar</id>
  167. <goals>
  168. <goal>jar</goal>
  169. </goals>
  170. <configuration>
  171. <archive>
  172. <manifest>
  173. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  174. </manifest>
  175. <manifestEntries>
  176. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_${os.detected.arch}.so; osname=Linux; processor=${os.detected.arch},*</Bundle-NativeCode>
  177. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  178. </manifestEntries>
  179. <index>true</index>
  180. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  181. </archive>
  182. <classifier>${jni.classifier}</classifier>
  183. </configuration>
  184. </execution>
  185. </executions>
  186. </plugin>
  187. <plugin>
  188. <artifactId>maven-antrun-plugin</artifactId>
  189. <executions>
  190. <execution>
  191. <!-- Phase must be before regex-glibc-sendmmsg and regex-linux-sendmmsg -->
  192. <phase>validate</phase>
  193. <goals>
  194. <goal>run</goal>
  195. </goals>
  196. <id>ant-get-systeminfo</id>
  197. <configuration>
  198. <exportAntProperties>true</exportAntProperties>
  199. <tasks>
  200. <exec executable="sh" outputproperty="ldd_version">
  201. <arg value="-c" />
  202. <arg value="ldd --version | head -1" />
  203. </exec>
  204. <exec executable="uname" outputproperty="uname_os_version">
  205. <arg value="-r" />
  206. </exec>
  207. </tasks>
  208. </configuration>
  209. </execution>
  210. </executions>
  211. </plugin>
  212. <plugin>
  213. <groupId>org.codehaus.mojo</groupId>
  214. <artifactId>build-helper-maven-plugin</artifactId>
  215. <executions>
  216. <execution>
  217. <!-- Phase must be before regex-combined-sendmmsg -->
  218. <phase>initialize</phase>
  219. <id>regex-glibc-sendmmsg</id>
  220. <goals>
  221. <goal>regex-property</goal>
  222. </goals>
  223. <configuration>
  224. <name>glibc.sendmmsg.support</name>
  225. <value>${ldd_version}</value>
  226. <!-- Version must be >= 2.14 - set to IO_NETTY_SENDMSSG_NOT_FOUND if this version is not satisfied -->
  227. <regex>^((?!^[^)]+\)\s+(0*2\.1[4-9]|0*2\.[2-9][0-9]+|0*[3-9][0-9]*|0*[1-9]+[0-9]+).*).)*$</regex>
  228. <replacement>IO_NETTY_SENDMSSG_NOT_FOUND</replacement>
  229. <failIfNoMatch>false</failIfNoMatch>
  230. </configuration>
  231. </execution>
  232. <execution>
  233. <!-- Phase must be before regex-combined-sendmmsg -->
  234. <phase>initialize</phase>
  235. <id>regex-linux-sendmmsg</id>
  236. <goals>
  237. <goal>regex-property</goal>
  238. </goals>
  239. <configuration>
  240. <name>linux.sendmmsg.support</name>
  241. <value>${uname_os_version}</value>
  242. <!-- Version must be >= 3 - set to IO_NETTY_SENDMSSG_NOT_FOUND if this version is not satisfied -->
  243. <regex>^((?!^[0-9]*[3-9]\.?.*).)*$</regex>
  244. <replacement>IO_NETTY_SENDMSSG_NOT_FOUND</replacement>
  245. <failIfNoMatch>false</failIfNoMatch>
  246. </configuration>
  247. </execution>
  248. <execution>
  249. <!-- Phase must be before regex-unset-if-needed-sendmmsg -->
  250. <phase>generate-sources</phase>
  251. <id>regex-combined-sendmmsg</id>
  252. <goals>
  253. <goal>regex-property</goal>
  254. </goals>
  255. <configuration>
  256. <name>jni.compiler.args.cflags</name>
  257. <value>${linux.sendmmsg.support}${glibc.sendmmsg.support}</value>
  258. <!-- If glibc and linux kernel are both not sufficient...then define the CFLAGS -->
  259. <regex>.*IO_NETTY_SENDMSSG_NOT_FOUND.*</regex>
  260. <replacement>CFLAGS=-O3 -DIO_NETTY_SENDMMSG_NOT_FOUND -Werror -fno-omit-frame-pointer -Wunused-variable -I${unix.common.include.unpacked.dir}</replacement>
  261. <failIfNoMatch>false</failIfNoMatch>
  262. </configuration>
  263. </execution>
  264. <execution>
  265. <!-- Phase must be before build-native-lib -->
  266. <phase>generate-sources</phase>
  267. <id>regex-unset-if-needed-sendmmsg</id>
  268. <goals>
  269. <goal>regex-property</goal>
  270. </goals>
  271. <configuration>
  272. <name>jni.compiler.args.cflags</name>
  273. <value>${jni.compiler.args.cflags}</value>
  274. <!-- If glibc and linux kernel are both not sufficient...then define the CFLAGS -->
  275. <regex>^((?!CFLAGS=).)*$</regex>
  276. <replacement>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -Wunused-variable -I${unix.common.include.unpacked.dir}</replacement>
  277. <failIfNoMatch>false</failIfNoMatch>
  278. </configuration>
  279. </execution>
  280. </executions>
  281. </plugin>
  282. </plugins>
  283. </build>
  284. <dependencies>
  285. <dependency>
  286. <groupId>io.netty</groupId>
  287. <artifactId>netty-transport-native-unix-common</artifactId>
  288. <version>${project.version}</version>
  289. <classifier>${jni.classifier}</classifier>
  290. <!--
  291. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  292. dependency to get the static library which is built directly into the shared library generated by this project.
  293. -->
  294. <optional>true</optional>
  295. </dependency>
  296. </dependencies>
  297. </profile>
  298. </profiles>
  299. <dependencies>
  300. <dependency>
  301. <groupId>io.netty</groupId>
  302. <artifactId>netty-common</artifactId>
  303. <version>${project.version}</version>
  304. </dependency>
  305. <dependency>
  306. <groupId>io.netty</groupId>
  307. <artifactId>netty-buffer</artifactId>
  308. <version>${project.version}</version>
  309. </dependency>
  310. <dependency>
  311. <groupId>io.netty</groupId>
  312. <artifactId>netty-transport-native-unix-common</artifactId>
  313. <version>${project.version}</version>
  314. </dependency>
  315. <dependency>
  316. <groupId>io.netty</groupId>
  317. <artifactId>netty-transport</artifactId>
  318. <version>${project.version}</version>
  319. </dependency>
  320. <dependency>
  321. <groupId>io.netty</groupId>
  322. <artifactId>netty-testsuite</artifactId>
  323. <version>${project.version}</version>
  324. <scope>test</scope>
  325. </dependency>
  326. <dependency>
  327. <groupId>io.netty</groupId>
  328. <artifactId>netty-transport-native-unix-common-tests</artifactId>
  329. <version>${project.version}</version>
  330. <scope>test</scope>
  331. </dependency>
  332. <dependency>
  333. <groupId>${project.groupId}</groupId>
  334. <artifactId>${tcnative.artifactId}</artifactId>
  335. <classifier>${tcnative.classifier}</classifier>
  336. <scope>test</scope>
  337. </dependency>
  338. </dependencies>
  339. <build>
  340. <plugins>
  341. <plugin>
  342. <artifactId>maven-jar-plugin</artifactId>
  343. <executions>
  344. <!-- Generate the fallback JAR that does not contain the native library. -->
  345. <execution>
  346. <id>default-jar</id>
  347. <configuration>
  348. <excludes>
  349. <exclude>META-INF/native/**</exclude>
  350. </excludes>
  351. </configuration>
  352. </execution>
  353. </executions>
  354. </plugin>
  355. </plugins>
  356. </build>
  357. </project>