From 2bf34890b590c8aac9cdd0cd98afb37afee6ef1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 17 Feb 2024 08:17:34 +0100 Subject: [PATCH] Only consider existing artifacts for the classpath Currently only if the artifact file is null it is not considered but if the file does not exits JDT complains. It even seems there was once in a time such a check but it is disabled, this is an attempt to check if we can reenable it again. --- .../m2e/jdt/internal/DefaultClasspathManagerDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java index af86b1f38f..bf4f8e9e7b 100644 --- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java +++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java @@ -137,7 +137,7 @@ void addClasspathEntries(IClasspathDescriptor classpath, IMavenProjectFacade fac } else { File artifactFile = a.getFile(); - if(artifactFile != null /*&& artifactFile.canRead()*/) { + if(artifactFile != null && artifactFile.exists()) { entry = classpath.addLibraryEntry(IPath.fromOSString(artifactFile.getAbsolutePath())); entry.setClasspathAttribute(IClasspathManager.TEST_ATTRIBUTE, addTestFlag ? "true" : null); }