arthas/arthas-vmtool/pom.xml

286 lines
12 KiB
XML
Raw Permalink Normal View History

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>
<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>
<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>
<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 -->
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<!-- 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>
</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>
<build>
<plugins>
<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>
<compilerStartOption>-I${JAVA_HOME}/include</compilerStartOption>
<compilerStartOption>-I${JAVA_HOME}/include/${os_name}</compilerStartOption>
<compilerStartOption>-I${project.build.directory}/native/include</compilerStartOption>
<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>
<id>compile-and-link</id>
<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>
2021-04-26 20:15:13 +08:00
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<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>
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>
<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>
<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>
<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>
<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>