Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.1
-
None
-
JRE 1.5.0_04-b05, WinXP / Solaris 8
Description
I have specified explicit ivy.dep.file property with absolute path (starting with ${basedir} that is absolute).
IvyRetrieve calls IveResolve (see stack trace below) during "ensureResolved()".
The problem is that IvyResolve.setFile() doesn't been call, and therefore, in IvyResolve.java:164, the basedir is prepanded to the 'ivy.dep.file' again and this leads to invalid path like:
M:\myproj\M:\myproj\build-def\ivy.xml (assuming my basedir is 'm:\myproj').
I must mention that I am already calling ivy-resolve before ivy-retrieve so there is no real need to recall ivy-resolve. I would expect ivy-ant to "remember" that resolve has been called (with whatever file I gave it) and not to recall resolve during ensureResolved().
On the other hand, I think line 164 of IvyResolve.java (where file assumed to be relative to basedir) must also be fixed.
Here is the stack trace plus ivy:retrieve output:
[ivy:retrieve] parameter found as ivy variable: ivy.organisation=myorg
[ivy:retrieve] parameter found as ivy variable: ivy.module=mymodule
[ivy:retrieve] using standard ensure resolved
[ivy:retrieve] parameter found as attribute value: ivy.resolved.configurations=schema
[ivy:retrieve] calculating configurations to resolve
[ivy:retrieve] resolved configurations: [runtime, compile, kodo-beans, postcompile, castor-beans, precompile, schema]
[ivy:retrieve] asked configurations: [schema]
[ivy:retrieve] to resolve configurations: []
[ivy:retrieve] parameter found as attribute value: ivy.resolved.configurations=schema
[ivy:retrieve] parameter found as attribute value: ivy.organisation=myorg
[ivy:retrieve] parameter found as attribute value: ivy.module=mymodule
[ivy:retrieve] parameter found as attribute value: ivy.retrieve.pattern=M:/myprojdir/mymodule/build/imported/[artifact].[ext]
[ivy:retrieve] :: retrieving :: [ myorg | mymodule ]
[ivy:retrieve] confs: [schema]
[ivy:retrieve] retrieving /home/myusername/.ivy/cache/myorg/mymodule_schema-1.0.0.0-build3/xsds/common.xsd
[ivy:retrieve] to M:/myprojdir/mymodule/build/imported/common.xsd [NOT REQUIRED]
[ivy:retrieve] 0 artifacts copied, 1 already retrieved
[ivy:retrieve] retrieve done (22ms)
Setting project property: ivy.nb.targets.copied -> 0
Setting project property: ivy.targets.copied -> false
[ivy:retrieve] parameter found as ivy variable: ivy.organisation=myorg
[ivy:retrieve] parameter found as ivy variable: ivy.module=mymodule
[ivy:retrieve] using standard ensure resolved
[ivy:retrieve] parameter found as attribute value: ivy.resolved.configurations=schema-non-transitive
[ivy:retrieve] calculating configurations to resolve
[ivy:retrieve] resolved configurations: [runtime, compile, kodo-beans, postcompile, castor-beans, precompile, schema]
[ivy:retrieve] asked configurations: [schema-non-transitive]
[ivy:retrieve] to resolve configurations: [schema-non-transitive]
[ivy:retrieve] no resolved descriptor found: launching default resolve
[ivy:retrieve] parameter found as attribute value: ivy.configurations=schema-non-transitive
[ivy:retrieve] parameter found as ivy variable: ivy.resolve.default.type.filter=*
[ivy:retrieve] parameter found as ivy variable: ivy.dep.file=M:/myprojdir/mymodule/build-def/ivy.xml
[ivy:retrieve] parameter found as ivy variable: ivy.revision=1.0.0.0-build1
[ivy:retrieve] using ivy parser to parse file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml
[ivy:retrieve] impossible to get date for file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml: using 'now'
[null] M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory) in file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml
BUILD FAILED
/home/myusername/build.xml:17: syntax errors in ivy file: java.text.ParseException: M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory) in file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml
at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:214)
at fr.jayasoft.ivy.ant.IvyTask.ensureResolved(IvyTask.java:125)
at fr.jayasoft.ivy.ant.IvyPostResolveTask.prepareAndCheck(IvyPostResolveTask.java:87)
at fr.jayasoft.ivy.ant.IvyRetrieve.execute(IvyRetrieve.java:31)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.text.ParseException: M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory) in file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:163)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.access$000(XmlModuleDescriptorParser.java:114)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:78)
at fr.jayasoft.ivy.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:35)
at fr.jayasoft.ivy.Ivy.resolve(Ivy.java:1085)
at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:167)
... 15 more
Caused by: java.io.FileNotFoundException: M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
at fr.jayasoft.ivy.url.BasicURLHandler.openStream(BasicURLHandler.java:92)
at fr.jayasoft.ivy.url.URLHandlerDispatcher.openStream(URLHandlerDispatcher.java:63)
at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:66)
at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:62)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:147)
... 20 more
— Nested Exception —
java.text.ParseException: M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory) in file:M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:163)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.access$000(XmlModuleDescriptorParser.java:114)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:78)
at fr.jayasoft.ivy.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:35)
at fr.jayasoft.ivy.Ivy.resolve(Ivy.java:1085)
at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:167)
at fr.jayasoft.ivy.ant.IvyTask.ensureResolved(IvyTask.java:125)
at fr.jayasoft.ivy.ant.IvyPostResolveTask.prepareAndCheck(IvyPostResolveTask.java:87)
at fr.jayasoft.ivy.ant.IvyRetrieve.execute(IvyRetrieve.java:31)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.io.FileNotFoundException: M:/myprojdir/mymoduleM:/myprojdir/mymodule/build-def/ivy.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
at fr.jayasoft.ivy.url.BasicURLHandler.openStream(BasicURLHandler.java:92)
at fr.jayasoft.ivy.url.URLHandlerDispatcher.openStream(URLHandlerDispatcher.java:63)
at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:66)
at fr.jayasoft.ivy.util.XMLHelper.parse(XMLHelper.java:62)
at fr.jayasoft.ivy.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:147)
... 20 more