中配置这个插件
我想用Maven为我的项目创建*.exe文件。我使用launch4j-maven-plugin
,它工作,但它需要fileVersion
和productVersion
格式为"x.x.x.x"。我需要fileVersion
作为"x.x.x.x",productVersion
作为"x.x.x.x"。我可以更改这个格式吗?我的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'
可能存在另一个maven插件创建*.exe文件?
try MVN assembly:single。它专门用于创建可执行的jar文件。
你还需要在你的pom.xml