tschulte/gradle-jnlp-plugin

resources/jar attribute download

ilsaul opened this issue · 2 comments

I know this version can't do, but I need to specify the download attribute.

e.g.: <jar href="lib/foo.Jar" download="eager" version="1.2"/>

There is a way that you implement this?

download="eager" is the default, when nothing is given. If you also want to support download="lazy", the plugin must also generate an index.list and put it in the main jar file. Without the index.list webstart does not know which jar it has to download.

So to solve this issue, the plugin must be able to generate an index.list containing entries for all jars of the application (http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR_Index). This indext.list must be added to the main jar file prior signing.

How should this option work? Option useDownloadLazy in GradleJnlpPluginExtension, main jar download="eager", all other jars download="lazy"? Or more fine grained control over which jars should be eager or lazy?

I would default this option to false (don't use lazy download). One problem with lazy download option is, that there is no indication of the lazy download. Using eager for all jars, you get a progress bar in the beginning. Once the download is complete, there will be no slow down due to any download activity, but using lazy download option, the application might seem unresponsive for some time because it does download another jar in the background.

Another problem with index.list is, that it does not contain all paths in the jar. Sub-Folders of META-INF are not listed. This causes problems, when you use e.g. java.util.ServiceLoader: The first time you use it, webstart has to load all jars anyway in that case, but now without progress bar.

As a side note: The plugin does currently even remove all index.list files from all jars. The reason was we had one jar file in our project (some third party dependency has it in its jar file). This did cause problems when trying to launch the application. Reminder to myself: create a bug-report at Oracle.

Thank you for your explanation I will not use the lazy