update at 2022-11-14 14:40:18 by ehlxr

This commit is contained in:
ehlxr 2022-11-14 14:40:18 +08:00
parent fd8c563be7
commit 909fa120e4
3 changed files with 58 additions and 8 deletions

View File

@ -1 +1,6 @@
`native-image -cp "target/classes:lib/*" io.github.ehlxr.murmur3.Murmur3Applicatio` built as a standalone executable
built as a standalone executable
* manual
`target/classes:/Users/ehlxr/.m2/repository/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar`
* maven
* `mvn -Pnative package`

Binary file not shown.

59
pom.xml
View File

@ -1,6 +1,6 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.ehlxr</groupId>
<artifactId>murmur3</artifactId>
@ -8,10 +8,11 @@
<name>murmur3</name>
<description>murmur3</description>
<properties>
<java.version>1.8</java.version>
<!--目标编译的 Java 版本可以通过以下属性指定,不用配置 maven-compiler-plugin 插件-->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<native.maven.plugin.version>0.9.12</native.maven.plugin.version>
<maven.compiler.source>${java.specification.version}</maven.compiler.source>
<maven.compiler.target>${java.specification.version}</maven.compiler.target>
<imageName>murmur3</imageName>
<mainClass>io.github.ehlxr.murmur3.Murmur3Application</mainClass>
</properties>
<dependencies>
<dependency>
@ -41,7 +42,7 @@
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>io.github.ehlxr.murmur3.Murmur3Application</mainClass>
</transformer>
</transformers>
@ -52,4 +53,48 @@
</plugins>
</build>
</project>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>test-native</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
<configuration>
<fallback>false</fallback>
<buildArgs>
<arg>-H:DashboardDump=fortune -H:+DashboardAll</arg>
</buildArgs>
<agent>
<enabled>true</enabled>
<options>
<option>experimental-class-loader-support</option>
</options>
</agent>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>