Bug 45846 - Ant 1.7.1 resolves UNC path file imports incorrectly on windows
Summary: Ant 1.7.1 resolves UNC path file imports incorrectly on windows
Status: RESOLVED DUPLICATE of bug 42275
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.7.1
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-19 08:57 UTC by Miles Daffin
Modified: 2008-10-15 00:00 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Daffin 2008-09-19 08:57:28 UTC
Hi,

I have a core build file deployed on a network file system that is accessible from both windows and unix. This core build file is imported and used by a number of other project builds that just provide properties to configure the core build for usage. 

The core build file imports a number of other files containing utility macrodefs etc. These are deployed in the same directory as the core build (I use the dirname task to construct the import path for the other files). It uses UNC style paths to do this, for example:

  <import file="//u/some/path/accessible/from/windows/and/unix/machines/build.xml"/>

Paths like this were handled without issue in ant 1.6.5. On unix the extra forward slash was irrelevant and on windows the path seps were flipped by java to yield a valid UNC path. However, if I run the following import on windows under a Java 6 VM with ant 1.7.1 I now get this error:

Cannot find build-utils.xml imported from C:\u\some\path\accessible\from\windows\and\unix\machines\build.xml

I have seen a related problem if I put ant on the path using a UNC path (e.g. if I deploy my ant install on a network drive). When I run ant I get this exception.

java.lang.ClassNotFoundException: org.apache.tools.ant.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:255)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

This goes if I map a network drive to the ant deployment directory and put it on the path using a path via this drive instead.

Does anyone know what's going one here?

Thanks,

Miles
Comment 1 Stefan Bodewig 2008-09-25 06:47:32 UTC
I can confirm this behavior in 1.7.1 and can confirm it is fixed in trunk.

*** This bug has been marked as a duplicate of bug 42275 ***
Comment 2 Mike Murray 2008-10-14 09:48:09 UTC
Which file contains the fix for this bug?
Comment 3 Stefan Bodewig 2008-10-15 00:00:30 UTC
It is this commit

http://svn.eu.apache.org/viewvc?view=rev&revision=631263