You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ja...@apache.org on 2017/08/28 11:48:56 UTC

ant-ivy git commit: IVY-1566 - Store External form of URL in cached files

Repository: ant-ivy
Updated Branches:
  refs/heads/master b691f81b4 -> 0cdcb1fd8


IVY-1566 - Store External form of URL in cached files

This closes #59 pull request at github/apache/ant-ivy repo


Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/0cdcb1fd
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/0cdcb1fd
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/0cdcb1fd

Branch: refs/heads/master
Commit: 0cdcb1fd8df9e9185cd3abb128d927d25d7de8b5
Parents: b691f81
Author: Aurélien Pupier <ap...@redhat.com>
Authored: Thu Aug 10 15:57:42 2017 +0200
Committer: Jaikiran Pai <ja...@apache.org>
Committed: Mon Aug 28 17:17:22 2017 +0530

----------------------------------------------------------------------
 asciidoc/release-notes.adoc                                 | 3 +++
 .../ivy/core/cache/DefaultRepositoryCacheManager.java       | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/0cdcb1fd/asciidoc/release-notes.adoc
----------------------------------------------------------------------
diff --git a/asciidoc/release-notes.adoc b/asciidoc/release-notes.adoc
index cdad6e8..95d95b4 100644
--- a/asciidoc/release-notes.adoc
+++ b/asciidoc/release-notes.adoc
@@ -69,6 +69,7 @@ For details about the following changes, check our JIRA install at link:https://
 - FIX: HTTP issue: Basic authentication is stuck in 401 loop (jira:IVY-1336[])
 - FIX: command line: -types seems to not accept comma [jira:IVY-1355[]]
 - FIX: Mixed use of symlinks leads to cache corruption [jira:IVY-1498[]] (Thanks to Stephen Haberman)
+- FIX: Some cached location are badly stored which results in MalformedURLException [jira:IVY-1566[]] (Thanks to Aur&#233;lien Pupier)
 
 - IMPROVEMENT: Throw an IllegalStateException when retrieving the resolutionCacheRoot on the DefaultResolutionCacheManager if the basedir (or IvySettings) is not set (jira:IVY-1482[])
 - IMPROVEMENT: Optimization: limit the revision numbers scanned if revision prefix is specified (Thanks to Ernestas Vaiciukevi&#269;ius)
@@ -240,3 +241,5 @@ Here is the list of people who have contributed source code and documentation up
 * Sven Zethelius
 * Aleksey Zhukov
 * Zhong Wang
+* Aur&#233;lien Pupier
+

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/0cdcb1fd/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java b/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
index 4d30340..aca7718 100644
--- a/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
+++ b/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
@@ -1452,10 +1452,15 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
     }
 
     private ArtifactOrigin getDefaultMetadataArtifactOrigin(ModuleRevisionId mrid) {
+        final String location;
+        try {
+            location = this.getIvyFileInCache(mrid).toURI().toURL().toExternalForm();
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Failed to determine artifact origin for " + mrid);
+        }
         // it's important to say the origin is not local to make sure it won't ever be used for
         // anything else than original token
-        return new ArtifactOrigin(DefaultArtifact.newIvyArtifact(mrid, null), false,
-                getIvyFileInCache(mrid).getPath());
+        return new ArtifactOrigin(DefaultArtifact.newIvyArtifact(mrid, null), false, location);
     }
 
     private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) {