Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon property is handled incorrectly when infile is specified in pom.xml #266

Closed
skarpushin opened this issue Apr 16, 2023 · 2 comments
Closed

Comments

@skarpushin
Copy link
Contributor

skarpushin commented Apr 16, 2023

Here is example config I use:

<plugin>
	<groupId>com.akathist.maven.plugins.launch4j</groupId>
	<artifactId>launch4j-maven-plugin</artifactId>
	<version>2.3.3</version>
	<executions>
		<execution>
			<id>l4j-gui</id>
			<phase>package</phase>
			<goals>
				<goal>launch4j</goal>
			</goals>
			<configuration>
				<infile>${project.basedir}/installer/launch4j.xml</infile>
				<jar>pgptoolgui-${project.version}.jar</jar>
				<outfile>${project.basedir}/target/pgptool.exe</outfile>
				<icon>${project.basedir}/src/main/resources/icons/favicon.ico</icon>
				<versionInfo>
					<fileVersion>${project.version}</fileVersion>
					<txtFileVersion>${project.version}</txtFileVersion>
					<productVersion>${project.version}</productVersion>
					<txtProductVersion>${project.version}</txtProductVersion>
				</versionInfo>
			</configuration>
		</execution>
	</executions>
</plugin>

If I build with this config, I get error:

[ERROR] 
net.sf.launch4j.BuilderException: Icon doesn't exist.
    at net.sf.launch4j.Builder.build (Builder.java:76)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.doExecute (Launch4jMojo.java:471)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute (Launch4jMojo.java:339)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)

RCA:
I ran build in debug mode and found that Launch4jMojo#icon is correctly initialized and resolved to actual file, but in method Launch4jMojo#doExecute execution goes into if (infile != null) { branch in which value of said field is ignored and build fails.

@lukaszlenart
Copy link
Collaborator

Do you use the inifile?

@skarpushin
Copy link
Contributor Author

Yes

lukaszlenart added a commit that referenced this issue Apr 18, 2023
Fix for #266 icon property is handled incorrectly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants