尝试创建 maven jlink 时看不到 Java 图像

问题描述

我创建了一个简单的项目,我想在其中创建 Windows 图像。我有一个带有 maven-jlink-plugin 的 maven 项目。我正在使用 Netbeans 和 Widows 10。当我创建图像时,它看起来不错,但我没有看到 .bath 文件

        <artifactId>maven-jlink-plugin</artifactId>
            <version>3.1.0</version>
            <extensions>true</extensions>
            <configuration>
                <strinpDebug>true</strinpDebug>
                <noHeaderFiles>true</noHeaderFiles>
               
                <jlinkImageName>hello</jlinkImageName>
                <mainClass>com.todlist.testingapp.HelloWorld</mainClass>
                <noManPages>true</noManPages>
            </configuration>

enter image description here

有人可以知道哪个是错误或我需要修复/更改什么吗?

解决方法

把配置部分改成这样:

<configuration>
   <launcher>FILENAME=ARTIFACTID/PACKAGE.MAINCLASS</launcher> 
</configuration>

哪里 FILENAME 是你想要的启动器文件的名称 ARTIFACTID 是您的 Maven 模块的 artifactId PACKAGE 是你的主类所在的包 MAINCLASS 是你的主类的名称

示例: 您有一个带有工件 ID Prototype 的模块,一个名为 Program 的主类,位于名为 com.test.main 的包中,并且您想要一个hello.bat 文件作为您的启动器,您将获得: hello=Prototype/com.test.main.Program