ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Multi-Release JAR file patch as applied to build 108 of Java 9 breaks almost every project out there (Apache Ant, Gradle, partly Apache Maven)
Date Sat, 05 Mar 2016 22:43:18 GMT
Hi Stefan,

> -----Original Message-----
> From: Stefan Bodewig []
> Sent: Saturday, March 05, 2016 7:56 PM
> To:; Uwe Schindler <>
> Cc: 'Alan Bateman' <>; core-libs-
> 'Steve Drach' <>
> Subject: Re: Multi-Release JAR file patch as applied to build 108 of Java 9
> breaks almost every project out there (Apache Ant, Gradle, partly Apache
> Maven)
> On 2016-03-05, Uwe Schindler wrote:
> > This is why I put the Ant developers in CC. The correct way would be
> > to look at the *decoded* path (not just getPath() because this is also
> > one of the "famous" traps in the URL class - one reason why it should
> > be avoided in favor of URI). URL.toURI().getPath() is most safe to fix
> > the issue in Apache Ant
> Part of the reason for this certainly is that the code has been written
> before the URI class even existed.
> > (Stefan Bodewig: Should I open an issue in Ant?).
> Yes, please do. Thanks Uwe.

I opened:
> > Maybe Ant developers can fix this code in later versions to handle
> > URLs more correct.
> +1

Unfortunately this is not the only issue caused by this. After I tried to build Lucene with
the patch applied, the next candidate for the issue broke:
Apache Ivy. It was no longer able to load the ivy-settings.xml file from its JAR file.

The reason here is another one: It constructs the JAR file URL on its own (it looks like this),
but does not add the #release fragment. And because of this, JarURLConnection does not find
the file...:

[...] multiple parent causes [...]
Caused by: JAR entry org/apache/ivy/core/settings/ivysett/ivysettings-public.xml
not found in C:\Users\Uwe Schindler\.ant\lib\ivy-2.3.0.jar
        at org.apache.ivy.util.url.BasicURLHandler.openStream(
        at org.apache.ivy.util.url.URLHandlerDispatcher.openStream(
        at org.apache.ivy.core.settings.XmlSettingsParser.doParse(
        at org.apache.ivy.core.settings.XmlSettingsParser.parse(
        at org.apache.ivy.core.settings.XmlSettingsParser.includeStarted(
        at org.apache.ivy.core.settings.XmlSettingsParser.startElement(
        ... 35 more

So it looks like the Multi-release JAR file patch also breaks the other way round: Code constructing
JAR URLs according to the standard no longer work. In my opinion, the JAR URLs should not
change at all and the code should transparently choose the right release version. Maybe add
a fragment only to explicitly state a specific version (so one would be able to load the Java
7 version). But this could also be done using the META-INF/... path. The default handling
should be that "old" and (I think they are standardized) JAR URLs still works as they should
- not requiring the fragment!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message