sonatype / install4j-support

Install4j Support
http://sonatype.github.io/install4j-support/
11 stars 11 forks source link

Avoid hitting the command line length limit if compiler variables with long values are configured #27

Closed ingokegel closed 8 years ago

ingokegel commented 8 years ago

The maximum length of the command line can be quite low (8192 on Windows). In the upcoming install4j 6.1 release it will be possible to pass lists of files in compiler variables that can be added to the distribution tree or launcher classpaths. To avoid problems with truncated command lines, this patch passes compiler variables in a temporary file that is deleted after the execution. This change is backwards-compatible with install4j versions down to 4.1.5.

Also, the install4j runtime is now available in a repository. I've added it to the top-level pom, please change as appropriate.

jdillon commented 8 years ago

@ingokegel can more than one --var-file be specified? this changes all variables to be passed by file ref, but what if you already had a variable file want to use it + others defined from build execution?

If it supports more than one, then we can have one being user-managed, and another generated for any variables configured.

ingokegel commented 8 years ago

can more than one --var-file be specified

Currently not, this will only be possible in install4j 6.1. However, what is supported since 4.1.5 is the ability to use a single --var-file argument with multiple files separated by semicolons. That's what the patch uses, so there will be no difference with respect to the previous behavior.

jdillon commented 8 years ago

Will tidy up a few things and merge this in the next day or so.

Thanks!

jdillon commented 8 years ago

@ingokegel I've merged a similar version. I exposed the variable file for mvn config, and leaving it in build output directory instead of auto-deleting it for debugging purposes. Mvn plugins that magically write out tmp files then delete them can be very hard to debug when/if things go south.

If folks really want to have this magically vanish I can add a flag to enable automatic deletion (or retention depending on which way the boolean flies).

ingokegel commented 8 years ago

@jdillon Thank you! Keeping the file for debugging purposes sounds like a good idea.

jdillon commented 8 years ago

@ingokegel snapshots are deployed, let me know if you run into any problems, otherwise I can stage a release if you have folks itching to use this.

ingokegel commented 8 years ago

@jdillon It's not really urgent, install4j 6.1 is still two weeks away and then people first have to start using ultra-long variable values with the new features before it becomes a problem.