Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-04-27 10:43:48 -0400
committerMatthew Piggott2011-04-27 10:43:48 -0400
commit73850d334ff170b66585c3152c07284f9643e069 (patch)
tree7640aa3152411d087ec245eeb5aae176a90b0ee6 /org.eclipse.m2e.discovery
parent8e1002a4f9cbc2884053a8b9ac6ecdf48acea158 (diff)
downloadm2e-core-73850d334ff170b66585c3152c07284f9643e069.tar.gz
m2e-core-73850d334ff170b66585c3152c07284f9643e069.tar.xz
m2e-core-73850d334ff170b66585c3152c07284f9643e069.zip
Bug 342894 - MavenDiscoveryService does not delete temporary files
- Disable caching on jar connection
Diffstat (limited to 'org.eclipse.m2e.discovery')
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
index d71698a3..df5f565e 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
@@ -14,6 +14,7 @@ package org.eclipse.m2e.internal.discovery;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.net.JarURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
@@ -133,7 +134,10 @@ public class MavenDiscovery {
if(url == null) {
return null;
}
- InputStream is = url.openStream();
+ // To ensure we can delete the temporary file we need to prevent caching, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4386865
+ JarURLConnection conn = (JarURLConnection) url.openConnection();
+ conn.setDefaultUseCaches(false);
+ InputStream is = conn.getInputStream();
try {
return LifecycleMappingFactory.createLifecycleMappingMetadataSource(is);
} finally {

Back to the top