FibreFoX / javafx-gradle-plugin

Gradle plugin for JavaFX
Apache License 2.0
427 stars 59 forks source link

compression issue with spring boot #107

Closed ttarcher closed 6 years ago

ttarcher commented 6 years ago

Hi, when I use springboot to build my application, it didn't work at first. I figure out it cause by the mainClass, so I change it :

jfx {
    mainClass = 'org.springframework.boot.loader.JarLauncher'
    vendor = 'Todd'
    bundler = "ALL"
    manifestAttributes = ["Start-Class": "com.example.demo.MainClass"]
}

and then use the jfxRun

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/javax.annotation-api-1.3.2.jar
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:86)
    at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:70)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/javax.annotation-api-1.3.2.jar'
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:232)
    at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
    ... 4 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/javax.annotation-api-1.3.2.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
    at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:275)
    at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:255)
    at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:243)
    ... 6 more
:jfxRun FAILED

but I don't found any setting for compression.

ps: any better way to set the spring boot mainClass ? Thanks.

FibreFoX commented 6 years ago

This is already reported: https://github.com/FibreFoX/javafx-gradle-plugin/issues/83