[英]Maven plugin for creating an *.exe file
我想使用Maven為我的項目創建* .exe文件。 我使用launch4j-maven-plugin
可以工作,但是它需要fileVersion
和productVersion
格式為“ xxxx”。 我需要fileVersion
為“ xxx”, productVersion
為“ xxxx”。 我可以更改這種格式嗎? 我的pom.xml:
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>l4j-clui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<jar>${project.build.directory}/${project.build.finalName}-jar-with-dependencies.jar</jar>
<outfile>${project.build.directory}/${exeFileName}.exe</outfile>
<downloadUrl>http://java.com/download</downloadUrl>
<classPath>
<mainClass>MainClass</mainClass>
<preCp>anything</preCp>
</classPath>
<icon>${project.basedir}/src/main/assembly/application.ico</icon>
<jre>
<minVersion>1.7.0_00</minVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
<versionInfo>
<fileVersion>${project.version}.${buildNumber}</fileVersion>
<txtFileVersion>txtFileVersion</txtFileVersion>
<fileDescription>${product.name}</fileDescription>
<copyright>${project.organization.name}</copyright>
<productVersion>${project.version}</productVersion>
<txtProductVersion>txtProductVersion</txtProductVersion>
<productName>${product.name}</productName>
<companyName>${product.company}</companyName>
<internalName>abc</internalName>
<originalFilename>${exeFileName}.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
我的例外:
[ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.5.2:launch4j (l4j-clui) on project MyProject: Failed to build the executable; please verify your configuration. Invalid data: File version, should be 'x.x.x.x'
可能存在用於創建* .exe文件的另一個Maven插件?
嘗試mvn assembly:single。 它專門用於創建可執行jar文件。
另外,您需要在pom.xml中配置此插件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.