2021-04-26 20:15:13 +08:00
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<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/xsd/maven-4.0.0.xsd">
|
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
|
<parent>
|
|
|
|
|
<artifactId>arthas-all</artifactId>
|
|
|
|
|
<groupId>com.taobao.arthas</groupId>
|
|
|
|
|
<version>${revision}</version>
|
|
|
|
|
<relativePath>../pom.xml</relativePath>
|
|
|
|
|
</parent>
|
2021-04-26 20:38:25 +08:00
|
|
|
|
<artifactId>arthas-vmtool</artifactId>
|
|
|
|
|
<name>arthas-vmtool</name>
|
2022-11-18 11:21:53 +08:00
|
|
|
|
<url>https://github.com/alibaba/arthas</url>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
|
|
|
|
|
<profiles>
|
2021-04-27 20:19:26 +08:00
|
|
|
|
<!-- https://github.com/openjdk/jdk/blob/jdk-16%2B36/src/java.base/windows/native/libjava/java_props_md.c#L568 -->
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<!-- macos -->
|
|
|
|
|
<profile>
|
2021-04-27 20:19:26 +08:00
|
|
|
|
<id>macos-amd64</id>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<family>mac</family>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<os_name>darwin</os_name>
|
2021-12-02 19:03:31 +08:00
|
|
|
|
<os_arch_option>-arch x86_64 -arch arm64</os_arch_option>
|
|
|
|
|
<lib_name>libArthasJniLibrary.dylib</lib_name>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
|
|
|
|
|
|
|
|
|
<!-- linux -->
|
|
|
|
|
<profile>
|
|
|
|
|
<id>linux-amd64</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<name>linux</name>
|
|
|
|
|
<arch>amd64</arch>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
|
|
|
|
<os_name>linux</os_name>
|
|
|
|
|
<os_arch_option>-m64</os_arch_option>
|
2021-04-27 20:19:26 +08:00
|
|
|
|
<lib_name>libArthasJniLibrary-x64.so</lib_name>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
2023-04-19 13:23:42 +08:00
|
|
|
|
<profile>
|
|
|
|
|
<id>linux-aarch64</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<name>linux</name>
|
|
|
|
|
<arch>aarch64</arch>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
|
|
|
|
<os_name>linux</os_name>
|
|
|
|
|
<os_arch_option>-march=armv8-a</os_arch_option>
|
|
|
|
|
<lib_name>libArthasJniLibrary-aarch64.so</lib_name>
|
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
|
2023-04-19 17:28:44 +08:00
|
|
|
|
<!-- linux other-arch-->
|
|
|
|
|
<profile>
|
|
|
|
|
<id>linux-${os.arch}</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<name>linux</name>
|
|
|
|
|
<arch>!amd64</arch>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
|
|
|
|
<os_name>linux</os_name>
|
|
|
|
|
<lib_name>libArthasJniLibrary-${os.arch}.so</lib_name>
|
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
|
|
|
|
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<!-- windows -->
|
2022-10-19 16:00:07 +08:00
|
|
|
|
<profile>
|
|
|
|
|
<id>windows</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<family>windows</family>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<!-- https://github.com/mojohaus/maven-native/blob/maven-native-1.0-alpha-11/native-maven-plugin/src/site/apt/examples/jni-dll.apt#L67-->
|
|
|
|
|
<os_name>win32</os_name>
|
2022-10-19 16:00:07 +08:00
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
|
|
|
|
<profile>
|
|
|
|
|
<id>windows-32</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<family>windows</family>
|
|
|
|
|
<arch>x86</arch>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
|
|
|
|
<os_arch_option>-m32</os_arch_option>
|
|
|
|
|
<lib_name>libArthasJniLibrary-x86.dll</lib_name>
|
|
|
|
|
</properties>
|
|
|
|
|
</profile>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<profile>
|
|
|
|
|
<id>windows-amd64</id>
|
|
|
|
|
<activation>
|
|
|
|
|
<os>
|
|
|
|
|
<family>windows</family>
|
|
|
|
|
<arch>amd64</arch>
|
|
|
|
|
</os>
|
|
|
|
|
</activation>
|
|
|
|
|
<properties>
|
|
|
|
|
<os_arch_option>-m64</os_arch_option>
|
2021-04-27 20:19:26 +08:00
|
|
|
|
<lib_name>libArthasJniLibrary-x64.dll</lib_name>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</properties>
|
2021-07-06 20:42:55 +08:00
|
|
|
|
<build>
|
|
|
|
|
<plugins>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
|
2021-07-06 20:42:55 +08:00
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
|
|
|
<artifactId>native-maven-plugin</artifactId>
|
|
|
|
|
<version>1.0-alpha-11</version>
|
|
|
|
|
<extensions>true</extensions>
|
|
|
|
|
<configuration>
|
|
|
|
|
<javahIncludes>
|
|
|
|
|
<javahInclude>
|
|
|
|
|
<className>arthas.VmTool</className>
|
|
|
|
|
</javahInclude>
|
|
|
|
|
</javahIncludes>
|
|
|
|
|
<javahOS>${os_name}</javahOS>
|
|
|
|
|
<sources>
|
|
|
|
|
<source>
|
|
|
|
|
<directory>src/main/native/src</directory>
|
|
|
|
|
<fileNames>
|
|
|
|
|
<fileName>jni-library.cpp</fileName>
|
|
|
|
|
</fileNames>
|
|
|
|
|
</source>
|
|
|
|
|
</sources>
|
|
|
|
|
|
|
|
|
|
<compilerProvider>generic-classic</compilerProvider>
|
|
|
|
|
<compilerExecutable>g++</compilerExecutable>
|
|
|
|
|
<compilerStartOptions>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<compilerStartOption>-I${JAVA_HOME}/include</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-I${JAVA_HOME}/include/${os_name}</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-I${project.build.directory}/native/include</compilerStartOption>
|
2021-07-06 20:42:55 +08:00
|
|
|
|
<compilerStartOption>${os_arch_option}</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-fpic</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-shared</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-o</compilerStartOption>
|
|
|
|
|
</compilerStartOptions>
|
|
|
|
|
|
|
|
|
|
<linkerOutputDirectory>target</linkerOutputDirectory>
|
|
|
|
|
<linkerExecutable>g++</linkerExecutable>
|
|
|
|
|
<linkerStartOptions>
|
|
|
|
|
<linkerStartOption>${os_arch_option}</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-fpic</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-shared</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-o</linkerStartOption>
|
|
|
|
|
<!-- for windows #1833 -->
|
|
|
|
|
<linkerStartOption>-static-libstdc++</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-static</linkerStartOption>
|
|
|
|
|
</linkerStartOptions>
|
|
|
|
|
<linkerEndOptions>
|
|
|
|
|
<linkerEndOption>-o ${project.build.directory}/${lib_name}</linkerEndOption>
|
|
|
|
|
</linkerEndOptions>
|
|
|
|
|
</configuration>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<id>compile-and-link</id>
|
2021-07-06 20:42:55 +08:00
|
|
|
|
<phase>compile</phase>
|
|
|
|
|
<goals>
|
|
|
|
|
<goal>initialize</goal>
|
|
|
|
|
<goal>compile</goal>
|
|
|
|
|
<goal>link</goal>
|
|
|
|
|
</goals>
|
|
|
|
|
</execution>
|
|
|
|
|
</executions>
|
|
|
|
|
</plugin>
|
|
|
|
|
</plugins>
|
|
|
|
|
</build>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</profile>
|
2023-04-19 17:08:50 +08:00
|
|
|
|
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</profiles>
|
|
|
|
|
|
|
|
|
|
<build>
|
|
|
|
|
<plugins>
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
|
|
|
<configuration>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<compilerArgs>
|
|
|
|
|
<!-- 需要使用 3.8.0 及之后版本,使用javac -h 生成头文件 -->
|
|
|
|
|
<arg>-h</arg>
|
|
|
|
|
<arg>${project.build.directory}/native/include</arg>
|
|
|
|
|
</compilerArgs>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</configuration>
|
|
|
|
|
</plugin>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<!-- 请不要删除这里的maven-jar-plugin,也不要升级它的版本,否则很可能无法正常打包 -->
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
|
|
|
<version>2.4</version>
|
|
|
|
|
</plugin>
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
|
|
|
<artifactId>native-maven-plugin</artifactId>
|
|
|
|
|
<version>1.0-alpha-11</version>
|
|
|
|
|
<extensions>true</extensions>
|
|
|
|
|
<configuration>
|
2021-04-30 19:11:52 +08:00
|
|
|
|
<javahIncludes>
|
|
|
|
|
<javahInclude>
|
|
|
|
|
<className>arthas.VmTool</className>
|
|
|
|
|
</javahInclude>
|
|
|
|
|
</javahIncludes>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<sources>
|
|
|
|
|
<source>
|
|
|
|
|
<directory>src/main/native/src</directory>
|
|
|
|
|
<fileNames>
|
|
|
|
|
<fileName>jni-library.cpp</fileName>
|
|
|
|
|
</fileNames>
|
|
|
|
|
</source>
|
|
|
|
|
</sources>
|
|
|
|
|
|
|
|
|
|
<compilerProvider>generic-classic</compilerProvider>
|
|
|
|
|
<compilerExecutable>g++</compilerExecutable>
|
|
|
|
|
<compilerStartOptions>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<compilerStartOption>-I${JAVA_HOME}/include</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-I${JAVA_HOME}/include/${os_name}</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-I${project.build.directory}/native/include</compilerStartOption>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<compilerStartOption>${os_arch_option}</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-fpic</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-shared</compilerStartOption>
|
|
|
|
|
<compilerStartOption>-o</compilerStartOption>
|
|
|
|
|
</compilerStartOptions>
|
|
|
|
|
|
|
|
|
|
<linkerOutputDirectory>target</linkerOutputDirectory>
|
|
|
|
|
<linkerExecutable>g++</linkerExecutable>
|
|
|
|
|
<linkerStartOptions>
|
|
|
|
|
<linkerStartOption>${os_arch_option}</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-fpic</linkerStartOption>
|
|
|
|
|
<linkerStartOption>-shared</linkerStartOption>
|
2021-12-02 19:03:31 +08:00
|
|
|
|
<!-- <linkerStartOption>-o</linkerStartOption> -->
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</linkerStartOptions>
|
|
|
|
|
<linkerEndOptions>
|
2021-05-13 20:21:35 +08:00
|
|
|
|
<linkerEndOption>-o ${project.build.directory}/${lib_name}</linkerEndOption>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</linkerEndOptions>
|
|
|
|
|
</configuration>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
2023-04-23 15:17:20 +08:00
|
|
|
|
<id>compile-and-link</id>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<phase>compile</phase>
|
|
|
|
|
<goals>
|
|
|
|
|
<goal>initialize</goal>
|
|
|
|
|
<goal>compile</goal>
|
|
|
|
|
<goal>link</goal>
|
|
|
|
|
</goals>
|
|
|
|
|
</execution>
|
|
|
|
|
</executions>
|
|
|
|
|
</plugin>
|
|
|
|
|
</plugins>
|
|
|
|
|
</build>
|
|
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>com.taobao.arthas</groupId>
|
|
|
|
|
<artifactId>arthas-common</artifactId>
|
|
|
|
|
<version>${project.version}</version>
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
2023-09-20 15:35:50 +08:00
|
|
|
|
<groupId>org.junit.vintage</groupId>
|
|
|
|
|
<artifactId>junit-vintage-engine</artifactId>
|
|
|
|
|
<scope>test</scope>
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.junit.jupiter</groupId>
|
|
|
|
|
<artifactId>junit-jupiter</artifactId>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
<scope>test</scope>
|
|
|
|
|
</dependency>
|
2021-05-07 19:47:02 +08:00
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.assertj</groupId>
|
|
|
|
|
<artifactId>assertj-core</artifactId>
|
|
|
|
|
<scope>test</scope>
|
|
|
|
|
</dependency>
|
2021-04-26 20:15:13 +08:00
|
|
|
|
</dependencies>
|
|
|
|
|
</project>
|