You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Nicolas Lalevée (JIRA)" <ji...@apache.org> on 2014/12/26 21:04:16 UTC
[jira] [Updated] (IVY-1472) Failed to resolve dependency due to
extra "slash" in URL
[ https://issues.apache.org/jira/browse/IVY-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Lalevée updated IVY-1472:
---------------------------------
Fix Version/s: (was: master)
2.4.0
> Failed to resolve dependency due to extra "slash" in URL
> --------------------------------------------------------
>
> Key: IVY-1472
> URL: https://issues.apache.org/jira/browse/IVY-1472
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.4.0-RC1
> Environment: Mac OS X 10.9.2., Ivy 2.4.0-RC1, Ant 1.9.3, JDK 1.7.0_55
> Reporter: Jifeng Zhang
> Assignee: Maarten Coene
> Priority: Critical
> Fix For: 2.4.0
>
> Attachments: IVY-1472.patch, IVY-1472.zip
>
>
> We have a self build ivy repo (basically a http server serving files, not maven 2 compatible) for storing in house built libraries and all 3rd party libs, this is how our resolver looks like:
> {code:xml}
> <ivysettings>
> <settings defaultResolver="default" />
> <caches defaultCacheDir="${basedir}/ivy-cache" />
> <resolvers>
> <url name="internal">
> <ivy pattern="http://dev/repo/[org]/[module]/[module]-[revision]/ivy-[revision].xml" />
> <artifact pattern="http://dev/repo/[org]/[module]/[module]-[revision]/[artifact]-[revision].[ext]" />
> </url>
> <chain name="default">
> <resolver ref="internal"/>
> </chain>
> </resolvers>
> </ivysettings>
> {code}
> We have been using ivy 2.2.0 for some time and everything works. Recently we tried to use ivy 2.4.0-RC1, suddenly we can not resolve the libraries using the version matcher, for example:
> {code:xml}
> <dependency org="foo" name="module1" rev="+" changing="true" conf="runtime"/>
> {code}
> Ivy complains
> {code}
> CLIENT ERROR: Not Found url=http://dev/repo/foo/module1/module1-0.0.1/ivy-0.0.1/.xml
> CLIENT ERROR: Not Found url=http://dev/repo/foo/module1/module1-0.0.2/ivy-0.0.2/.xml
> CLIENT ERROR: Not Found url=http://dev/repo/foo/module1/module1-0.0.3/ivy-0.0.3/.xml
> CLIENT ERROR: Not Found url=http://dev/repo/foo/module1/module1-0.0.4/ivy-0.0.4/.xml
> {code}
> You can notice that there is an extra "/" after the version number, before the .xml extension.
> With -verbose option, I noticed that when it found revs, it output:
> {code}
> found revs: [0.0.1/, 0.0.2/, 0.0.3/, 0.0.4/]
> {code}
> When we use ivy-2.2.0, the output is:
> {code}
> found revs: [0.0.1, 0.0.2, 0.0.3, 0.0.4]
> {code}
> Further digging into source code of Ivy,
> In version 2.2.0, org.apache.ivy.plugins.resolver.util.ResolverHelper, line 76 uses following pattern to match and remove the tailing slash:
> {code}
> String acceptNamePattern = ".*?"+ IvyPatternHelper.substituteToken(namePattern, token, "([^" + fileSep+ "]+)") + "($|" + fileSep + ".*)";
> {code}
> But in 2.4.0-RC1, line 76 , that code has been changed to:
> {code}
> namePattern = IvyPatternHelper.substituteToken(namePattern, token, "(.+)");
> {code}
> Which will fail to remove the tailing slash.
> Is this a bug or what is the background of changing the regex?
> Thanks.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)