netty-resolver-dns-native-macos-4.1.110.Final.pom 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2019 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.110.Final</version>
  23. </parent>
  24. <artifactId>netty-resolver-dns-native-macos</artifactId>
  25. <name>Netty/Resolver/DNS/Native/MacOS</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 -Wl,-platform_version,macos,10.9,10.9</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>hawtjni-maven-plugin</artifactId>
  66. <executions>
  67. <execution>
  68. <id>build-native-lib</id>
  69. <configuration>
  70. <name>netty_resolver_dns_native_macos_${os.detected.arch}</name>
  71. <nativeSourceDirectory>${project.basedir}/src/main/c</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. <arg>MACOSX_DEPLOYMENT_TARGET=10.9</arg>
  81. </configureArgs>
  82. </configuration>
  83. <goals>
  84. <goal>generate</goal>
  85. <goal>build</goal>
  86. </goals>
  87. </execution>
  88. </executions>
  89. </plugin>
  90. <plugin>
  91. <artifactId>maven-jar-plugin</artifactId>
  92. <executions>
  93. <!-- Generate the JAR that contains the native library in it. -->
  94. <execution>
  95. <id>native-jar</id>
  96. <goals>
  97. <goal>jar</goal>
  98. </goals>
  99. <configuration>
  100. <archive>
  101. <manifest>
  102. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  103. <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
  104. </manifest>
  105. <manifestEntries>
  106. <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_${os.detected.arch}.jnilib; osname=MacOSX; processor=${os.detected.arch}</Bundle-NativeCode>
  107. <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
  108. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  109. </manifestEntries>
  110. <index>true</index>
  111. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  112. </archive>
  113. <classifier>${jni.classifier}</classifier>
  114. </configuration>
  115. </execution>
  116. </executions>
  117. </plugin>
  118. </plugins>
  119. </build>
  120. <dependencies>
  121. <dependency>
  122. <groupId>io.netty</groupId>
  123. <artifactId>netty-transport-native-unix-common</artifactId>
  124. <version>${project.version}</version>
  125. <classifier>${jni.classifier}</classifier>
  126. <!--
  127. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  128. dependency to get the static library which is built directly into the shared library generated by this project.
  129. -->
  130. <optional>true</optional>
  131. </dependency>
  132. </dependencies>
  133. </profile>
  134. <profile>
  135. <id>mac-m1-cross-compile</id>
  136. <properties>
  137. <jni.compiler.args.ldflags>LDFLAGS=-arch arm64 -Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,11.0,11.0</jni.compiler.args.ldflags>
  138. <jni.compiler.args.cflags>CFLAGS=-target arm64-apple-macos11 -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
  139. <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
  140. <jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
  141. <javaModuleNameClassifier>${os.detected.name}.aarch_64</javaModuleNameClassifier>
  142. <skipTests>true</skipTests>
  143. </properties>
  144. <build>
  145. <plugins>
  146. <plugin>
  147. <artifactId>maven-dependency-plugin</artifactId>
  148. <executions>
  149. <!-- unpack the unix-common static library and include files -->
  150. <execution>
  151. <id>unpack</id>
  152. <phase>generate-sources</phase>
  153. <goals>
  154. <goal>unpack-dependencies</goal>
  155. </goals>
  156. <configuration>
  157. <includeGroupIds>${project.groupId}</includeGroupIds>
  158. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  159. <classifier>${jni.classifier}</classifier>
  160. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  161. <includes>META-INF/native/**</includes>
  162. <overWriteReleases>false</overWriteReleases>
  163. <overWriteSnapshots>true</overWriteSnapshots>
  164. </configuration>
  165. </execution>
  166. </executions>
  167. </plugin>
  168. <plugin>
  169. <groupId>org.fusesource.hawtjni</groupId>
  170. <artifactId>hawtjni-maven-plugin</artifactId>
  171. <executions>
  172. <execution>
  173. <id>build-native-lib</id>
  174. <configuration>
  175. <name>netty_resolver_dns_native_macos_aarch_64</name>
  176. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  177. <libDirectory>${project.build.outputDirectory}</libDirectory>
  178. <!-- We use Maven's artifact classifier instead.
  179. This hack will make the hawtjni plugin to put the native library
  180. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  181. <platform>.</platform>
  182. <configureArgs>
  183. <arg>${jni.compiler.args.ldflags}</arg>
  184. <arg>${jni.compiler.args.cflags}</arg>
  185. <configureArg>--host=aarch64-apple-darwin</configureArg>
  186. <arg>MACOSX_DEPLOYMENT_TARGET=11.0</arg>
  187. </configureArgs>
  188. </configuration>
  189. <goals>
  190. <goal>generate</goal>
  191. <goal>build</goal>
  192. </goals>
  193. </execution>
  194. </executions>
  195. </plugin>
  196. <plugin>
  197. <artifactId>maven-jar-plugin</artifactId>
  198. <executions>
  199. <!-- Generate the JAR that contains the native library in it. -->
  200. <execution>
  201. <id>native-jar</id>
  202. <goals>
  203. <goal>jar</goal>
  204. </goals>
  205. <configuration>
  206. <archive>
  207. <manifest>
  208. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  209. <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
  210. </manifest>
  211. <manifestEntries>
  212. <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_aarch_64.jnilib; osname=MacOSX; processor=aarch64</Bundle-NativeCode>
  213. <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
  214. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  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>mac-intel-cross-compile</id>
  242. <properties>
  243. <jni.compiler.args.ldflags>LDFLAGS=-arch x86_64 -Wl,-weak_library,${unix.common.lib.unpacked.dir}/lib${unix.common.lib.name}.a -Wl,-platform_version,macos,10.9,10.9</jni.compiler.args.ldflags>
  244. <jni.compiler.args.cflags>CFLAGS=-target x86_64-apple-macos10.9 -O3 -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -I${unix.common.include.unpacked.dir}</jni.compiler.args.cflags>
  245. <!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
  246. <jni.classifier>${os.detected.name}-x86_64</jni.classifier>
  247. <javaModuleNameClassifier>${os.detected.name}.x86_64</javaModuleNameClassifier>
  248. <skipTests>true</skipTests>
  249. </properties>
  250. <build>
  251. <plugins>
  252. <plugin>
  253. <artifactId>maven-dependency-plugin</artifactId>
  254. <executions>
  255. <!-- unpack the unix-common static library and include files -->
  256. <execution>
  257. <id>unpack</id>
  258. <phase>generate-sources</phase>
  259. <goals>
  260. <goal>unpack-dependencies</goal>
  261. </goals>
  262. <configuration>
  263. <includeGroupIds>${project.groupId}</includeGroupIds>
  264. <includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
  265. <classifier>${jni.classifier}</classifier>
  266. <outputDirectory>${unix.common.lib.dir}</outputDirectory>
  267. <includes>META-INF/native/**</includes>
  268. <overWriteReleases>false</overWriteReleases>
  269. <overWriteSnapshots>true</overWriteSnapshots>
  270. </configuration>
  271. </execution>
  272. </executions>
  273. </plugin>
  274. <plugin>
  275. <groupId>org.fusesource.hawtjni</groupId>
  276. <artifactId>hawtjni-maven-plugin</artifactId>
  277. <executions>
  278. <execution>
  279. <id>build-native-lib</id>
  280. <configuration>
  281. <name>netty_resolver_dns_native_macos_x86_64</name>
  282. <nativeSourceDirectory>${project.basedir}/src/main/c</nativeSourceDirectory>
  283. <libDirectory>${project.build.outputDirectory}</libDirectory>
  284. <!-- We use Maven's artifact classifier instead.
  285. This hack will make the hawtjni plugin to put the native library
  286. under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
  287. <platform>.</platform>
  288. <configureArgs>
  289. <arg>${jni.compiler.args.ldflags}</arg>
  290. <arg>${jni.compiler.args.cflags}</arg>
  291. <configureArg>--host=x86_64-apple-darwin</configureArg>
  292. <arg>MACOSX_DEPLOYMENT_TARGET=10.9</arg>
  293. </configureArgs>
  294. </configuration>
  295. <goals>
  296. <goal>generate</goal>
  297. <goal>build</goal>
  298. </goals>
  299. </execution>
  300. </executions>
  301. </plugin>
  302. <plugin>
  303. <artifactId>maven-jar-plugin</artifactId>
  304. <executions>
  305. <!-- Generate the JAR that contains the native library in it. -->
  306. <execution>
  307. <id>native-jar</id>
  308. <goals>
  309. <goal>jar</goal>
  310. </goals>
  311. <configuration>
  312. <archive>
  313. <manifest>
  314. <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
  315. <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
  316. </manifest>
  317. <manifestEntries>
  318. <Bundle-NativeCode>META-INF/native/libnetty_resolver_dns_native_macos_x86_64.jnilib; osname=MacOSX; processor=x86_64</Bundle-NativeCode>
  319. <Fragment-Host>io.netty.resolver-dns-classes-macos</Fragment-Host>
  320. <Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
  321. </manifestEntries>
  322. <index>true</index>
  323. <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
  324. </archive>
  325. <classifier>${jni.classifier}</classifier>
  326. </configuration>
  327. </execution>
  328. </executions>
  329. </plugin>
  330. </plugins>
  331. </build>
  332. <dependencies>
  333. <dependency>
  334. <groupId>io.netty</groupId>
  335. <artifactId>netty-transport-native-unix-common</artifactId>
  336. <version>${project.version}</version>
  337. <classifier>${jni.classifier}</classifier>
  338. <!--
  339. The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
  340. dependency to get the static library which is built directly into the shared library generated by this project.
  341. -->
  342. <optional>true</optional>
  343. </dependency>
  344. </dependencies>
  345. </profile>
  346. </profiles>
  347. <properties>
  348. <javaModuleNameClassifier>${os.detected.name}.${os.detected.arch}</javaModuleNameClassifier>
  349. <javaModuleName>io.netty.resolver.dns.macos.${javaModuleNameClassifier}</javaModuleName>
  350. <!-- Needed as we use SelfSignedCertificate in our tests -->
  351. <unix.common.lib.name>netty-unix-common</unix.common.lib.name>
  352. <unix.common.lib.dir>${project.build.directory}/unix-common-lib</unix.common.lib.dir>
  353. <unix.common.lib.unpacked.dir>${unix.common.lib.dir}/META-INF/native/lib</unix.common.lib.unpacked.dir>
  354. <unix.common.include.unpacked.dir>${unix.common.lib.dir}/META-INF/native/include</unix.common.include.unpacked.dir>
  355. <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>
  356. <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>
  357. <japicmp.skip>true</japicmp.skip>
  358. <!-- Always check JNI during test run so we catch bugs that could cause crashes -->
  359. <argLine.jni>-Xcheck:jni</argLine.jni>
  360. </properties>
  361. <dependencies>
  362. <dependency>
  363. <groupId>io.netty</groupId>
  364. <artifactId>netty-resolver-dns-classes-macos</artifactId>
  365. <version>${project.version}</version>
  366. </dependency>
  367. </dependencies>
  368. <build>
  369. <plugins>
  370. <plugin>
  371. <artifactId>maven-jar-plugin</artifactId>
  372. <executions>
  373. <!-- Generate the fallback JAR that does not contain the native library. -->
  374. <execution>
  375. <id>default-jar</id>
  376. <configuration>
  377. <excludes>
  378. <exclude>META-INF/native/**</exclude>
  379. </excludes>
  380. </configuration>
  381. </execution>
  382. </executions>
  383. </plugin>
  384. </plugins>
  385. </build>
  386. </project>