netty-transport-native-epoll-4.1.100.Final.pom 19 KB

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