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

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