netty-transport-native-epoll-4.1.53.Final.pom 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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.53.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 as we use SelfSignedCertificate in our tests -->
  30. <argLine.java9.extras>--add-exports java.base/sun.security.x509=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.cflags>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
  36. <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>
  37. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  38. <skipTests>true</skipTests>
  39. </properties>
  40. <profiles>
  41. <!--
  42. Netty must be released from RHEL 6.8 x86_64 or compatible so that:
  43. 1) we ship x86_64 version of epoll transport officially, and
  44. 2) we ensure the ABI compatibility with older GLIBC versions.
  45. The shared library built on a distribution with newer GLIBC
  46. will not run on older distributions.
  47. -->
  48. <profile>
  49. <id>restricted-release-epoll</id>
  50. <build>
  51. <pluginManagement>
  52. <plugins>
  53. <plugin>
  54. <artifactId>maven-enforcer-plugin</artifactId>
  55. <version>1.4.1</version>
  56. <dependencies>
  57. <!-- Provides the 'requireFilesContent' enforcer rule. -->
  58. <dependency>
  59. <groupId>com.ceilfors.maven.plugin</groupId>
  60. <artifactId>enforcer-rules</artifactId>
  61. <version>1.2.0</version>
  62. </dependency>
  63. </dependencies>
  64. </plugin>
  65. </plugins>
  66. </pluginManagement>
  67. <plugins>
  68. <plugin>
  69. <artifactId>maven-enforcer-plugin</artifactId>
  70. <executions>
  71. <execution>
  72. <id>enforce-release-environment</id>
  73. <goals>
  74. <goal>enforce</goal>
  75. </goals>
  76. <configuration>
  77. <rules>
  78. <requireProperty>
  79. <regexMessage>
  80. Release process must be performed on linux-x86_64.
  81. </regexMessage>
  82. <property>os.detected.classifier</property>
  83. <regex>^linux-x86_64$</regex>
  84. </requireProperty>
  85. <requireFilesContent>
  86. <message>
  87. Release process must be performed on RHEL 6.8 or its derivatives.
  88. </message>
  89. <files>
  90. <file>/etc/redhat-release</file>
  91. </files>
  92. <content>release 6.9</content>
  93. </requireFilesContent>
  94. </rules>
  95. </configuration>
  96. </execution>
  97. </executions>
  98. </plugin>
  99. </plugins>
  100. </build>
  101. </profile>
  102. <profile>
  103. <id>linux</id>
  104. <activation>
  105. <os>
  106. <family>linux</family>
  107. </os>
  108. </activation>
  109. <properties>
  110. <skipTests>false</skipTests>
  111. </properties>
  112. <build>
  113. <plugins>
  114. <plugin>
  115. <artifactId>maven-dependency-plugin</artifactId>
  116. <executions>
  117. <!-- unpack the unix-common static library and include files -->
  118. <execution>
  119. <id>unpack</id>
  120. <phase>generate-sources</phase>
  121. <goals>
  122. <goal>unpack-dependencies</goal>
  123. </goals>
  124. <configuration>
  125. <includeGroupIds>${project.groupId}</includeGroupIds>
  126. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  127. <classifier>${jni.classifier}</classifier>
  128. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  129. <includes>META-INF/native/**</includes>
  130. <overWriteReleases>false</overWriteReleases>
  131. <overWriteSnapshots>true</overWriteSnapshots>
  132. </configuration>
  133. </execution>
  134. </executions>
  135. </plugin>
  136. <plugin>
  137. <groupId>org.fusesource.hawtjni</groupId>
  138. <artifactId>maven-hawtjni-plugin</artifactId>
  139. <executions>
  140. <execution>
  141. <id>build-native-lib</id>
  142. <configuration>
  143. <name>netty_transport_native_epoll_${os.detected.arch}</name>
  144. <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
  145. <libDirectory>${project.build.outputDirectory}</libDirectory>
  146. <!-- We use Maven's artifact classifier instead.
  147. This hack will make the hawtjni plugin to put the native library
  148. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  149. <platform>.</platform>
  150. <configureArgs>
  151. <arg>${jni.compiler.args.ldflags}</arg>
  152. <arg>${jni.compiler.args.cflags}</arg>
  153. <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
  154. </configureArgs>
  155. </configuration>
  156. <goals>
  157. <goal>generate</goal>
  158. <goal>build</goal>
  159. </goals>
  160. </execution>
  161. </executions>
  162. </plugin>
  163. <plugin>
  164. <artifactId>maven-jar-plugin</artifactId>
  165. <executions>
  166. <!-- Generate the JAR that contains the native library in it. -->
  167. <execution>
  168. <id>native-jar</id>
  169. <goals>
  170. <goal>jar</goal>
  171. </goals>
  172. <configuration>
  173. <archive>
  174. <manifest>
  175. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  176. </manifest>
  177. <manifestEntries>
  178. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_${os.detected.arch}.so; osname=Linux; processor=${os.detected.arch},*</Bundle-NativeCode>
  179. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  180. </manifestEntries>
  181. <index>true</index>
  182. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  183. </archive>
  184. <classifier>${jni.classifier}</classifier>
  185. </configuration>
  186. </execution>
  187. </executions>
  188. </plugin>
  189. </plugins>
  190. </build>
  191. <dependencies>
  192. <dependency>
  193. <groupId>io.netty</groupId>
  194. <artifactId>netty-transport-native-unix-common</artifactId>
  195. <version>${project.version}</version>
  196. <classifier>${jni.classifier}</classifier>
  197. <!--
  198. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  199. dependency to get the static library which is built directly into the shared library generated by this project.
  200. -->
  201. <optional>true</optional>
  202. </dependency>
  203. </dependencies>
  204. </profile>
  205. <profile>
  206. <id>linux-aarch64</id>
  207. <properties>
  208. <jni.classifier>${os.detected.name}-aarch64</jni.classifier>
  209. </properties>
  210. <build>
  211. <pluginManagement>
  212. <plugins>
  213. <plugin>
  214. <artifactId>maven-enforcer-plugin</artifactId>
  215. <version>1.4.1</version>
  216. <dependencies>
  217. <!-- Provides the 'requireFilesContent' enforcer rule. -->
  218. <dependency>
  219. <groupId>com.ceilfors.maven.plugin</groupId>
  220. <artifactId>enforcer-rules</artifactId>
  221. <version>1.2.0</version>
  222. </dependency>
  223. </dependencies>
  224. </plugin>
  225. </plugins>
  226. </pluginManagement>
  227. <plugins>
  228. <plugin>
  229. <artifactId>maven-enforcer-plugin</artifactId>
  230. <executions>
  231. <execution>
  232. <id>enforce-release-environment</id>
  233. <goals>
  234. <goal>enforce</goal>
  235. </goals>
  236. <configuration>
  237. <rules>
  238. <requireProperty>
  239. <regexMessage>
  240. Cross compile and Release process must be performed on linux-x86_64.
  241. </regexMessage>
  242. <property>os.detected.classifier</property>
  243. <regex>^linux-x86_64.*</regex>
  244. </requireProperty>
  245. <requireFilesContent>
  246. <message>
  247. Cross compile and Release process must be performed on RHEL 7.6 or its derivatives.
  248. </message>
  249. <files>
  250. <file>/etc/redhat-release</file>
  251. </files>
  252. <content>release 7.6</content>
  253. </requireFilesContent>
  254. </rules>
  255. </configuration>
  256. </execution>
  257. </executions>
  258. </plugin>
  259. <plugin>
  260. <artifactId>maven-dependency-plugin</artifactId>
  261. <executions>
  262. <!-- unpack the unix-common static library and include files -->
  263. <execution>
  264. <id>unpack</id>
  265. <phase>generate-sources</phase>
  266. <goals>
  267. <goal>unpack-dependencies</goal>
  268. </goals>
  269. <configuration>
  270. <includeGroupIds>${project.groupId}</includeGroupIds>
  271. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  272. <classifier>${jni.classifier}</classifier>
  273. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  274. <includes>META-INF/native/**</includes>
  275. <overWriteReleases>false</overWriteReleases>
  276. <overWriteSnapshots>true</overWriteSnapshots>
  277. </configuration>
  278. </execution>
  279. </executions>
  280. </plugin>
  281. <plugin>
  282. <groupId>org.fusesource.hawtjni</groupId>
  283. <artifactId>maven-hawtjni-plugin</artifactId>
  284. <executions>
  285. <execution>
  286. <id>build-native-lib</id>
  287. <configuration>
  288. <name>netty_transport_native_epoll_aarch_64</name>
  289. <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
  290. <libDirectory>${project.build.outputDirectory}</libDirectory>
  291. <!-- We use Maven's artifact classifier instead.
  292. This hack will make the hawtjni plugin to put the native library
  293. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  294. <platform>.</platform>
  295. <configureArgs>
  296. <arg>${jni.compiler.args.ldflags}</arg>
  297. <arg>${jni.compiler.args.cflags}</arg>
  298. <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
  299. <configureArg>--host=aarch64-linux-gnu</configureArg>
  300. </configureArgs>
  301. </configuration>
  302. <goals>
  303. <goal>generate</goal>
  304. <goal>build</goal>
  305. </goals>
  306. </execution>
  307. </executions>
  308. </plugin>
  309. <plugin>
  310. <artifactId>maven-jar-plugin</artifactId>
  311. <executions>
  312. <!-- Generate the JAR that contains the native library in it. -->
  313. <execution>
  314. <id>native-jar</id>
  315. <goals>
  316. <goal>jar</goal>
  317. </goals>
  318. <configuration>
  319. <archive>
  320. <manifest>
  321. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  322. </manifest>
  323. <manifestEntries>
  324. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_epoll_aarch_64.so; osname=Linux; processor=aarch_64,*</Bundle-NativeCode>
  325. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  326. </manifestEntries>
  327. <index>true</index>
  328. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  329. </archive>
  330. <classifier>${jni.classifier}</classifier>
  331. </configuration>
  332. </execution>
  333. </executions>
  334. </plugin>
  335. </plugins>
  336. </build>
  337. <dependencies>
  338. <dependency>
  339. <groupId>io.netty</groupId>
  340. <artifactId>netty-transport-native-unix-common</artifactId>
  341. <version>${project.version}</version>
  342. <classifier>${jni.classifier}</classifier>
  343. <!--
  344. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  345. dependency to get the static library which is built directly into the shared library generated by this project.
  346. -->
  347. <optional>true</optional>
  348. </dependency>
  349. </dependencies>
  350. </profile>
  351. </profiles>
  352. <dependencies>
  353. <dependency>
  354. <groupId>io.netty</groupId>
  355. <artifactId>netty-common</artifactId>
  356. <version>${project.version}</version>
  357. </dependency>
  358. <dependency>
  359. <groupId>io.netty</groupId>
  360. <artifactId>netty-buffer</artifactId>
  361. <version>${project.version}</version>
  362. </dependency>
  363. <dependency>
  364. <groupId>io.netty</groupId>
  365. <artifactId>netty-transport</artifactId>
  366. <version>${project.version}</version>
  367. </dependency>
  368. <dependency>
  369. <groupId>io.netty</groupId>
  370. <artifactId>netty-transport-native-unix-common</artifactId>
  371. <version>${project.version}</version>
  372. </dependency>
  373. <dependency>
  374. <groupId>io.netty</groupId>
  375. <artifactId>netty-testsuite</artifactId>
  376. <version>${project.version}</version>
  377. <scope>test</scope>
  378. </dependency>
  379. <dependency>
  380. <groupId>io.netty</groupId>
  381. <artifactId>netty-transport-native-unix-common-tests</artifactId>
  382. <version>${project.version}</version>
  383. <scope>test</scope>
  384. </dependency>
  385. <dependency>
  386. <groupId>${project.groupId}</groupId>
  387. <artifactId>${tcnative.artifactId}</artifactId>
  388. <classifier>${tcnative.classifier}</classifier>
  389. <scope>test</scope>
  390. </dependency>
  391. </dependencies>
  392. <build>
  393. <plugins>
  394. <!-- Also include c files in source jar -->
  395. <plugin>
  396. <groupId>org.codehaus.mojo</groupId>
  397. <artifactId>build-helper-maven-plugin</artifactId>
  398. <executions>
  399. <execution>
  400. <phase>generate-sources</phase>
  401. <goals>
  402. <goal>add-source</goal>
  403. </goals>
  404. <configuration>
  405. <sources>
  406. <source>${nativeSourceDirectory}</source>
  407. </sources>
  408. </configuration>
  409. </execution>
  410. </executions>
  411. </plugin>
  412. <plugin>
  413. <artifactId>maven-jar-plugin</artifactId>
  414. <executions>
  415. <!-- Generate the fallback JAR that does not contain the native library. -->
  416. <execution>
  417. <id>default-jar</id>
  418. <configuration>
  419. <excludes>
  420. <exclude>META-INF/native/**</exclude>
  421. </excludes>
  422. </configuration>
  423. </execution>
  424. </executions>
  425. </plugin>
  426. </plugins>
  427. </build>
  428. </project>