netty-transport-native-epoll-4.1.76.Final.pom 18 KB

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