Open lasselindqvist opened 5 years ago
Hi, I am running into the same issue with some race condition preventing compilation some times. Have you found a workaround ?
I have actually done a workaround in a private fork. It uses a temp file to write the version. But honestly the whole check is unnecessarily and could be removed (https://github.com/sonatype/install4j-support/blob/2ef000a45149902f92e3ecd68df1f5eeff437776/install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/Install4jcMojoSupport.java#L92) if you just trust that you have the necessary version.
AntHelper.java seems to use outputstreams in such a way that the outputs might get mixed up with outputs from other running tasks.
This becomes a problem when trying to run the plugin as part of a multithreaded Maven build. It might fail to:
The Exception is thrown here: https://github.com/sonatype/install4j-support/blob/master/install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/VersionHelper.java#L87 and if I understand correctly, the root of the problem is AntHelper https://github.com/sonatype/install4j-support/blob/master/install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/AntHelper.java#L64
It seems to me that MavenAntLoggerAdapter is used and the output of calls is redirected to standard output where it mingles with other texts failing the version parsing.
Maybe the output could be redirected to a temporary file and read from there or fixed in some other way?