用户工具

站点工具


tools:launch4j
  • jdeps target.jar,计算依赖的模块
  • jlink –output minimal-with-logging –add-modules java.base,java.logging,提取jre
<properties>
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.main.class>hello.Hello</project.main.class>
</properties>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <archive>
            <manifest>
                <mainClass>${project.main.class}</mainClass>
                <addClasspath>true</addClasspath>
            </manifest>
        </archive>
    </configuration>
</plugin>
<plugin>
    <groupId>com.akathist.maven.plugins.launch4j</groupId>
    <artifactId>launch4j-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>l4j-clui</id>
            <phase>package</phase>
            <goals>
                <goal>launch4j</goal>
            </goals>
            <configuration>
                <dontWrapJar>true</dontWrapJar>
                <headerType>console</headerType>
                <jar>${project.artifactId}-${project.version}.jar</jar>
                <outfile>target\${project.artifactId}.exe</outfile>
                <icon></icon>
                <jre>
                    <path>jre</path>
                </jre>
            </configuration>
        </execution>
    </executions>
</plugin>
tools/launch4j.txt · 最后更改: 2020/09/29 23:18 由 admin