我正在尝试使用Maven构建一个exe,我使用Maven中的launch4j插件来遵循本指南。
http://www.hascode.com/2012/08/creating-a-windows-executable-from-a-jar-using-maven/
完成干净安装后, 我收到此错误
net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (1): C:\Users\User.Name\.m2\repository\com\akathist\maven\plugins\launch4j\launch4j-maven-plugin\1.5.1\launch4j-maven-plugin-1.5.1-workdir-win32\bin\windres.exe --preprocessor=type -J rc -O coff -F pe-i386 C:\Users\User~1.NAME\AppData\Local\Temp\launch4j4886282584342156537rc C:\Users\User~1.NAME\AppData\Local\Temp\launch4j7500715410847281339o
at net.sf.launch4j.Builder.build(Builder.java:144)
at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:353)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: net.sf.launch4j.ExecException: Exec failed (1): C:\Users\User.Name\.m2\repository\com\akathist\maven\plugins\launch4j\launch4j-maven-plugin\1.5.1\launch4j-maven-plugin-1.5.1-workdir-win32\bin\windres.exe --preprocessor=type -J rc -O coff -F pe-i386 C:\Users\User~1.NAME\AppData\Local\Temp\launch4j4886282584342156537rc C:\Users\User~1.NAME\AppData\Local\Temp\launch4j7500715410847281339o
at net.sf.launch4j.Util.exec(Util.java:148)
at net.sf.launch4j.Cmd.exec(Builder.java:205)
at net.sf.launch4j.Builder.build(Builder.java:97)
对此有何决议?
答案 0 :(得分:0)
问题是src / main / resources中的图标。这是一个损坏的.ico文件