Author: maartenc
Date: Mon Dec 15 14:32:55 2008
New Revision: 726861
URL: http://svn.apache.org/viewvc?rev=726861&view=rev
Log:
IMPROVEMENT: Support useOrigin for artifacts with a set url attribute (IVY-965)
(thanks to alex322) (merged from trunk)
Modified:
ant/ivy/core/branches/2.0.x/ (props changed)
ant/ivy/core/branches/2.0.x/CHANGES.txt
ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
Propchange: ant/ivy/core/branches/2.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 15 14:32:55 2008
@@ -1,2 +1,2 @@
/ant/ivy/core/branches/2.0.0-rc2:707177-709027
-/ant/ivy/core/trunk:695737,696014-696031,696442,698318-706770,709027-709034,709039-710178,720308-720591,721305-723065
+/ant/ivy/core/trunk:695737,696014-696031,696442,698318-706770,709027-709034,709039-710178,711197-718421,720308-720591,721305-723065
Modified: ant/ivy/core/branches/2.0.x/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/CHANGES.txt?rev=726861&r1=726860&r2=726861&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.0.x/CHANGES.txt Mon Dec 15 14:32:55 2008
@@ -84,6 +84,7 @@
2.0.0
=====================================
- IMPROVEMENT: Ivy Standalone setting to overwrite publications (IVY-976)
+- IMPROVEMENT: Support useOrigin for artifacts with a set url attribute
(IVY-965) (thanks to alex322)
- FIX: Log levels aren't respected in certain cases using the standalone
functionality (IVY-960) (thanks to Patrick Woodworth)
- FIX: NPE in LogReportOutputter (IVY-961)
Modified:
ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=726861&r1=726860&r2=726861&view=diff
==============================================================================
---
ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
(original)
+++
ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
Mon Dec 15 14:32:55 2008
@@ -64,6 +64,8 @@
import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
import org.apache.ivy.plugins.repository.Resource;
import org.apache.ivy.plugins.repository.ResourceDownloader;
+import org.apache.ivy.plugins.repository.file.FileRepository;
+import org.apache.ivy.plugins.repository.file.FileResource;
import org.apache.ivy.plugins.repository.url.URLRepository;
import org.apache.ivy.plugins.repository.url.URLResource;
import org.apache.ivy.plugins.resolver.util.MDResolvedResource;
@@ -920,7 +922,13 @@
URL url = artifact.getUrl();
Message.verbose("\tusing url for " + artifact + ": " + url);
logArtifactAttempt(artifact, url.toExternalForm());
- ret = new ResolvedResource(new URLResource(url),
artifact.getModuleRevisionId()
+ Resource resource;
+ if ("file".equals(url.getProtocol())) {
+ resource = new FileResource(new FileRepository(), new
File(url.getPath()));
+ } else {
+ resource = new URLResource(url);
+ }
+ ret = new ResolvedResource(resource,
artifact.getModuleRevisionId()
.getRevision());
}
return ret;