Re: [External] : Odd jdk8->jdk17 <jar> behaviour with ant
Dave Brosius <[email protected]> Mon, 4 Jul 2022 11:01:50 -0400
| Newsgroups | gmane.comp.jakarta.ant.user |
|---|---|
| Message-ID | <[email protected]> |
Rubber Duck Debugging at it's finest.
I changed the code to do
<jar destfile="${some_temp_location}"..../>
<move file="${some_temp_location}" tofile="${the_real_location}"/>
and now it works fine.
On 7/4/22 10:45, Dave Brosius wrote:
> Hi Folks,
>
> I realize this is probably difficult to understand, or give ideas
> on, but i'll give it a go.
>
> I have an existing build.xml file that's been used for years to build
> on java8 (ant 1.10.2). Now trying to migrate stuff to 17.
>
> Ran in to this problem, and going to simplify as best as possible.
>
> Have 3 ant targets, related as such
>
> <target name="coordinator" depends="producer, consumer"/>
>
> the producer target uses the <jar> task to produce a jar file, that
> includes resource bundle property files.
>
> the consumer target has a custom ant task that loads Locales using the
> above jar's resource bundles. (thus the above jar is on this task's
> classpath)
>
> In java 8 running
>
> ant coordinator
>
> works fine. In java 17, if I do
>
> ant producer
> ant consumer
>
> it also works fine, if however i do
>
> ant coordinator
>
> i get
>
> java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
>
>
> when the custom ant task tries to load the resource bundle from the jar
>
> I have to assume this is because ant isn't done writing the jar yet?
> Or maybe it hasn't been flushed yet? There is no ant task forking
> going on here. (Can you even fork a <jar> task?)
>
> Any ideas what could be wrong, or how to fix?
>
>
> thanks,
>
> dave
>