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

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