diff --git a/doc/release-notes.html b/doc/release-notes.html
index 085e4946..688d7224 100644
--- a/doc/release-notes.html
+++ b/doc/release-notes.html
@@ -68,6 +68,7 @@ List of changes since Ivy 2.4.0:
- FIX: Dependencies failed using branch attribute (and extra attributes) (IVY-1141) (Thanks to Stephen Haberman)
- FIX: useCacheOnly should allow lookup of changing dependencies in cache (IVY-1515) (Thanks to Ilya)
+- IMPROVEMENT: Throw an IllegalStateException when retrieving the resolutionCacheRoot on the DefaultResolutionCacheManager if the basedir (or IvySettings) is not set (IVY-1482)
- IMPROVEMENT: Optimization: limit the revision numbers scanned if revision prefix is specified (Thanks to Ernestas Vaiciukevičius)
- IMPROVEMENT: Update bouncycastle to 1.52 (IVY-1521) (Thanks to Michal Srb)
diff --git a/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java b/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
index d6bc2d72..9c421441 100644
--- a/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
+++ b/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
@@ -74,6 +74,12 @@ public class DefaultResolutionCacheManager implements ResolutionCacheManager, Iv
}
public File getResolutionCacheRoot() {
+ if (basedir == null) {
+ if (settings == null) {
+ throw new IllegalStateException("The 'basedir' or 'IvySettings' has not been set on the ResolutionCacheManager");
+ }
+ basedir = settings.getDefaultResolutionCacheBasedir();
+ }
return basedir;
}
@@ -213,7 +219,7 @@ public class DefaultResolutionCacheManager implements ResolutionCacheManager, Iv
}
public void clean() {
- FileUtil.forceDelete(getBasedir());
+ FileUtil.forceDelete(getResolutionCacheRoot());
}
private static class CacheParserSettings implements ParserSettings {