TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j
Apache License 2.0
298 stars 40 forks source link

Build fails with error: "Original filename exceeds the maximum length of 50 characters" #164

Closed dejan2609 closed 8 months ago

dejan2609 commented 9 months ago

Environment:

Reproducer: https://github.com/dejan2609/raccoon4/tree/gradle-8

How to reproduce error:

dejan@DESKTOP-Q4CPMFV MINGW64 /c/Work/raccoon4 (gradle-8)
$ git log --oneline -4
7a60443 (HEAD -> gradle-8, origin/gradle-8, Gradle-7-upgrade) line 27 is commented out
df8fbe1 Gradle upgrade 7 to 8
33de0af (origin/Gradle-7-upgrade) Gradle and gradle plugin (launch4j) version upgrades (with some gradle refactoring)
444fab2 Merge pull request #102 from jpstotz/exReport

dejan@DESKTOP-Q4CPMFV MINGW64 /c/Work/raccoon4 (gradle-8)
$ git diff
diff --git a/build.gradle b/build.gradle
index dbc5c67..0809e87 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,7 +24,7 @@ shadowJar  {
 }

 launch4j {
-  //outfile = 'Raccoon-' +version +'.exe'
+  outfile = 'Raccoon-' +version +'.exe'
   mainClassName = 'de.onyxbits.raccoon.Main'
   jvmOptions = [ "-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel", "-Djava.net.preferIPv4Stack=true" ]
   jarTask = project.tasks.shadowJar

dejan@DESKTOP-Q4CPMFV MINGW64 /c/Work/raccoon4 (gradle-8)
$ ./gradlew createExe
> Task :createExe FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':createExe'.
> net.sf.launch4j.BuilderException: Original filename exceeds the maximum length of 50 characters.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s
4 actionable tasks: 1 executed, 3 up-to-date

dejan@DESKTOP-Q4CPMFV MINGW64 /c/Work/raccoon4 (gradle-8)
TheBoegl commented 9 months ago

you are using the wrong version here, i.e. the plugins version property. Just use outfile = 'Raccoon-' +project.version +'.exe' instead.

dejan2609 commented 8 months ago

@TheBoegl thank you, man.

I was trying to digg deep into this and it turned out rather simple.

Kudos for your help 👍