netty-transport-native-kqueue-4.1.48.Final.pom 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2016 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.48.Final</version>
  23. </parent>
  24. <artifactId>netty-transport-native-kqueue</artifactId>
  25. <name>Netty/Transport/Native/KQueue</name>
  26. <packaging>jar</packaging>
  27. <profiles>
  28. <profile>
  29. <id>mac</id>
  30. <activation>
  31. <os>
  32. <family>mac</family>
  33. </os>
  34. </activation>
  35. <properties>
  36. <jni.compiler.args.ldflags>LDFLAGS=-Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a</jni.compiler.args.ldflags>
  37. <skipTests>false</skipTests>
  38. </properties>
  39. <build>
  40. <plugins>
  41. <plugin>
  42. <artifactId>maven-dependency-plugin</artifactId>
  43. <executions>
  44. <!-- unpack the unix-common static library and include files -->
  45. <execution>
  46. <id>unpack</id>
  47. <phase>generate-sources</phase>
  48. <goals>
  49. <goal>unpack-dependencies</goal>
  50. </goals>
  51. <configuration>
  52. <includeGroupIds>${project.groupId}</includeGroupIds>
  53. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  54. <classifier>${jni.classifier}</classifier>
  55. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  56. <includes>META-INF/native/**</includes>
  57. <overWriteReleases>false</overWriteReleases>
  58. <overWriteSnapshots>true</overWriteSnapshots>
  59. </configuration>
  60. </execution>
  61. </executions>
  62. </plugin>
  63. <plugin>
  64. <groupId>org.fusesource.hawtjni</groupId>
  65. <artifactId>maven-hawtjni-plugin</artifactId>
  66. <executions>
  67. <execution>
  68. <id>build-native-lib</id>
  69. <configuration>
  70. <name>netty_transport_native_kqueue_${os.detected.arch}</name>
  71. <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
  72. <libDirectory>${project.build.outputDirectory}</libDirectory>
  73. <!-- We use Maven's artifact classifier instead.
  74. This hack will make the hawtjni plugin to put the native library
  75. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  76. <platform>.</platform>
  77. <configureArgs>
  78. <arg>${jni.compiler.args.ldflags}</arg>
  79. <arg>${jni.compiler.args.cflags}</arg>
  80. <!-- support for __attribute__((weak_import)) by the linker was added in 10.2 (but 10.6 is the minimum we can use on 10.14) so ensure we
  81. explicitly set the target platform. Otherwise we may get fatal link errors due to weakly linked
  82. methods which are not expected to be present on MacOS (e.g. accept4). -->
  83. <arg>MACOSX_DEPLOYMENT_TARGET=10.6</arg>
  84. <configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
  85. </configureArgs>
  86. </configuration>
  87. <goals>
  88. <goal>generate</goal>
  89. <goal>build</goal>
  90. </goals>
  91. </execution>
  92. </executions>
  93. </plugin>
  94. <plugin>
  95. <artifactId>maven-jar-plugin</artifactId>
  96. <executions>
  97. <!-- Generate the JAR that contains the native library in it. -->
  98. <execution>
  99. <id>native-jar</id>
  100. <goals>
  101. <goal>jar</goal>
  102. </goals>
  103. <configuration>
  104. <archive>
  105. <manifest>
  106. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  107. </manifest>
  108. <manifestEntries>
  109. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_kqueue_${os.detected.arch}.jnilib; osname=MacOSX, processor=${os.detected.arch}"</Bundle-NativeCode>
  110. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  111. </manifestEntries>
  112. <index>true</index>
  113. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  114. </archive>
  115. <classifier>${jni.classifier}</classifier>
  116. </configuration>
  117. </execution>
  118. </executions>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. <dependencies>
  123. <dependency>
  124. <groupId>io.netty</groupId>
  125. <artifactId>netty-transport-native-unix-common</artifactId>
  126. <version>${project.version}</version>
  127. <classifier>${jni.classifier}</classifier>
  128. <!--
  129. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  130. dependency to get the static library which is built directly into the shared library generated by this project.
  131. -->
  132. <optional>true</optional>
  133. </dependency>
  134. </dependencies>
  135. </profile>
  136. <profile>
  137. <id>openbsd</id>
  138. <activation>
  139. <os>
  140. <family>unix</family>
  141. <name>openbsd</name>
  142. </os>
  143. </activation>
  144. <properties>
  145. <skipTests>false</skipTests>
  146. </properties>
  147. <build>
  148. <plugins>
  149. <plugin>
  150. <artifactId>maven-dependency-plugin</artifactId>
  151. <executions>
  152. <!-- unpack the unix-common static library and include files -->
  153. <execution>
  154. <id>unpack</id>
  155. <phase>generate-sources</phase>
  156. <goals>
  157. <goal>unpack-dependencies</goal>
  158. </goals>
  159. <configuration>
  160. <includeGroupIds>${project.groupId}</includeGroupIds>
  161. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  162. <classifier>${jni.classifier}</classifier>
  163. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  164. <includes>META-INF/native/**</includes>
  165. <overWriteReleases>false</overWriteReleases>
  166. <overWriteSnapshots>true</overWriteSnapshots>
  167. </configuration>
  168. </execution>
  169. </executions>
  170. </plugin>
  171. <plugin>
  172. <groupId>org.fusesource.hawtjni</groupId>
  173. <artifactId>maven-hawtjni-plugin</artifactId>
  174. <executions>
  175. <execution>
  176. <id>build-native-lib</id>
  177. <configuration>
  178. <name>netty_transport_native_kqueue_${os.detected.arch}</name>
  179. <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
  180. <libDirectory>${project.build.outputDirectory}</libDirectory>
  181. <!-- We use Maven's artifact classifier instead.
  182. This hack will make the hawtjni plugin to put the native library
  183. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  184. <platform>.</platform>
  185. <forceConfigure>true</forceConfigure>
  186. <forceAutogen>true</forceAutogen>
  187. <configureArgs>
  188. <arg>${jni.compiler.args.ldflags}</arg>
  189. <arg>${jni.compiler.args.cflags}</arg>
  190. </configureArgs>
  191. </configuration>
  192. <goals>
  193. <goal>generate</goal>
  194. <goal>build</goal>
  195. </goals>
  196. </execution>
  197. </executions>
  198. </plugin>
  199. <plugin>
  200. <artifactId>maven-jar-plugin</artifactId>
  201. <executions>
  202. <!-- Generate the JAR that contains the native library in it. -->
  203. <execution>
  204. <id>native-jar</id>
  205. <goals>
  206. <goal>jar</goal>
  207. </goals>
  208. <configuration>
  209. <archive>
  210. <manifest>
  211. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  212. </manifest>
  213. <manifestEntries>
  214. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_kqueue_${os.detected.arch}.jnilib; osname=OpenBSD, processor=${os.detected.arch}"</Bundle-NativeCode>
  215. </manifestEntries>
  216. <index>true</index>
  217. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  218. </archive>
  219. <classifier>${jni.classifier}</classifier>
  220. </configuration>
  221. </execution>
  222. </executions>
  223. </plugin>
  224. </plugins>
  225. </build>
  226. <dependencies>
  227. <dependency>
  228. <groupId>io.netty</groupId>
  229. <artifactId>netty-transport-native-unix-common</artifactId>
  230. <version>${project.version}</version>
  231. <classifier>${jni.classifier}</classifier>
  232. <!--
  233. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  234. dependency to get the static library which is built directly into the shared library generated by this project.
  235. -->
  236. <optional>true</optional>
  237. </dependency>
  238. </dependencies>
  239. </profile>
  240. <profile>
  241. <id>freebsd</id>
  242. <activation>
  243. <os>
  244. <family>unix</family>
  245. <name>freebsd</name>
  246. </os>
  247. </activation>
  248. <properties>
  249. <skipTests>false</skipTests>
  250. </properties>
  251. <build>
  252. <plugins>
  253. <plugin>
  254. <artifactId>maven-dependency-plugin</artifactId>
  255. <executions>
  256. <!-- unpack the unix-common static library and include files -->
  257. <execution>
  258. <id>unpack</id>
  259. <phase>generate-sources</phase>
  260. <goals>
  261. <goal>unpack-dependencies</goal>
  262. </goals>
  263. <configuration>
  264. <includeGroupIds>${project.groupId}</includeGroupIds>
  265. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  266. <classifier>${jni.classifier}</classifier>
  267. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  268. <includes>META-INF/native/**</includes>
  269. <overWriteReleases>false</overWriteReleases>
  270. <overWriteSnapshots>true</overWriteSnapshots>
  271. </configuration>
  272. </execution>
  273. </executions>
  274. </plugin>
  275. <plugin>
  276. <groupId>org.fusesource.hawtjni</groupId>
  277. <artifactId>maven-hawtjni-plugin</artifactId>
  278. <executions>
  279. <execution>
  280. <id>build-native-lib</id>
  281. <configuration>
  282. <name>netty_transport_native_kqueue_${os.detected.arch}</name>
  283. <nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
  284. <libDirectory>${project.build.outputDirectory}</libDirectory>
  285. <!-- We use Maven's artifact classifier instead.
  286. This hack will make the hawtjni plugin to put the native library
  287. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  288. <platform>.</platform>
  289. <forceConfigure>true</forceConfigure>
  290. <forceAutogen>true</forceAutogen>
  291. <configureArgs>
  292. <arg>${jni.compiler.args.ldflags}</arg>
  293. <arg>${jni.compiler.args.cflags}</arg>
  294. </configureArgs>
  295. </configuration>
  296. <goals>
  297. <goal>generate</goal>
  298. <goal>build</goal>
  299. </goals>
  300. </execution>
  301. </executions>
  302. </plugin>
  303. <plugin>
  304. <artifactId>maven-jar-plugin</artifactId>
  305. <executions>
  306. <!-- Generate the JAR that contains the native library in it. -->
  307. <execution>
  308. <id>native-jar</id>
  309. <goals>
  310. <goal>jar</goal>
  311. </goals>
  312. <configuration>
  313. <archive>
  314. <manifest>
  315. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  316. </manifest>
  317. <manifestEntries>
  318. <Bundle-NativeCode>META-INF/native/libnetty_transport_native_kqueue_${os.detected.arch}.jnilib; osname=FreeBSD, processor=${os.detected.arch}"</Bundle-NativeCode>
  319. </manifestEntries>
  320. <index>true</index>
  321. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  322. </archive>
  323. <classifier>${jni.classifier}</classifier>
  324. </configuration>
  325. </execution>
  326. </executions>
  327. </plugin>
  328. </plugins>
  329. </build>
  330. <dependencies>
  331. <dependency>
  332. <groupId>io.netty</groupId>
  333. <artifactId>netty-transport-native-unix-common</artifactId>
  334. <version>${project.version}</version>
  335. <classifier>${jni.classifier}</classifier>
  336. <!--
  337. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  338. dependency to get the static library which is built directly into the shared library generated by this project.
  339. -->
  340. <optional>true</optional>
  341. </dependency>
  342. </dependencies>
  343. </profile>
  344. </profiles>
  345. <properties>
  346. <javaModuleName>io.netty.transport.kqueue</javaModuleName>
  347. <!-- Needed as we use SelfSignedCertificate in our tests -->
  348. <argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
  349. <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
  350. <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
  351. <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
  352. <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
  353. <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>
  354. <jni.compiler.args.ldflags>LDFLAGS=-z now -L${unix.common.lib.unpacked.dir} -Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive</jni.compiler.args.ldflags>
  355. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  356. <skipTests>true</skipTests>
  357. </properties>
  358. <dependencies>
  359. <dependency>
  360. <groupId>io.netty</groupId>
  361. <artifactId>netty-common</artifactId>
  362. <version>${project.version}</version>
  363. </dependency>
  364. <dependency>
  365. <groupId>io.netty</groupId>
  366. <artifactId>netty-buffer</artifactId>
  367. <version>${project.version}</version>
  368. </dependency>
  369. <dependency>
  370. <groupId>io.netty</groupId>
  371. <artifactId>netty-transport</artifactId>
  372. <version>${project.version}</version>
  373. </dependency>
  374. <dependency>
  375. <groupId>io.netty</groupId>
  376. <artifactId>netty-transport-native-unix-common</artifactId>
  377. <version>${project.version}</version>
  378. </dependency>
  379. <dependency>
  380. <groupId>io.netty</groupId>
  381. <artifactId>netty-testsuite</artifactId>
  382. <version>${project.version}</version>
  383. <scope>test</scope>
  384. </dependency>
  385. <dependency>
  386. <groupId>io.netty</groupId>
  387. <artifactId>netty-transport-native-unix-common-tests</artifactId>
  388. <version>${project.version}</version>
  389. <scope>test</scope>
  390. </dependency>
  391. <dependency>
  392. <groupId>${project.groupId}</groupId>
  393. <artifactId>${tcnative.artifactId}</artifactId>
  394. <classifier>${tcnative.classifier}</classifier>
  395. <scope>test</scope>
  396. </dependency>
  397. </dependencies>
  398. <build>
  399. <plugins>
  400. <!-- Also include c files in source jar -->
  401. <plugin>
  402. <groupId>org.codehaus.mojo</groupId>
  403. <artifactId>build-helper-maven-plugin</artifactId>
  404. <executions>
  405. <execution>
  406. <phase>generate-sources</phase>
  407. <goals>
  408. <goal>add-source</goal>
  409. </goals>
  410. <configuration>
  411. <sources>
  412. <source>${nativeSourceDirectory}</source>
  413. </sources>
  414. </configuration>
  415. </execution>
  416. </executions>
  417. </plugin>
  418. <plugin>
  419. <artifactId>maven-jar-plugin</artifactId>
  420. <executions>
  421. <!-- Generate the fallback JAR that does not contain the native library. -->
  422. <execution>
  423. <id>default-jar</id>
  424. <configuration>
  425. <excludes>
  426. <exclude>META-INF/native/**</exclude>
  427. </excludes>
  428. </configuration>
  429. </execution>
  430. </executions>
  431. </plugin>
  432. </plugins>
  433. </build>
  434. </project>