Closed kurtseebauer closed 9 years ago
the issue has been brought up on stackoverflow also, but there doesn't seem to be a clear solution to it: http://stackoverflow.com/questions/9818721/wrapping-a-java-command-line-application-with-launch4j-and-maven
Here is the profile
I have been using to packages jar and it works very well.
<profile>
<!-- create Windows exe file -->
<id>izpack</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>antrun</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
toFile="${project.build.directory}/launcher.jar"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>l4j-clui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar>
<outfile>${project.build.directory}/launcher.exe</outfile>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl>http://www.softwaremill.pl/</supportUrl>
<customProcName>true</customProcName>
<stayAlive>false</stayAlive>
<icon>src/main/resources/launcher.ico</icon>
<singleInstance>
<mutexName>CDC-Launcher-Mutex</mutexName>
</singleInstance>
<classPath>
<mainClass>pl.softwaremill.circular.desktop.launcher.Launcher</mainClass>
<preCp>anything</preCp>
</classPath>
<jre>
<minVersion>1.6.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
<opts>
<opt>${allow.self.signed.certificate}</opt>
</opts>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>Circular Edit Launcher</fileDescription>
<copyright>SoftwareMill</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>${project.parent.version}</txtProductVersion>
<productName>Circular</productName>
<companyName>SoftwareMill</companyName>
<internalName>launcher</internalName>
<originalFilename>launcher.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
It'd be better if you could prepare a sample demo app to demonstrate your problem
<cp>.</cp>
is an invalid option, you can use either preCp
or postCp
/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* after this list.
*
* @parameter
*/
String preCp;
/**
* Part of the classpath that the executable should give to your application.
* Paths are relative to the executable and should be in Windows format (separated by a semicolon).
* You don't have to list all your dependencies here; the plugin will include them by default
* before this list.
*
* @parameter
*/
String postCp;
BTW, have the same issue right now.
@egrs more details please :)
seems like the error message simply indicates that one of the parameters is wrong, pretty misleading. In one case I got it because the icon was not found at the expected location. Better error handling would certainly be a good thing.
I'm getting the error
with Version 1.5.2 of the Plugin
but those parameters are present in the config:
Windows 8.1, current m2e eclipse plugin. Do you have any ideas? is this a known bug?