Skip to content

Commit 39e717f

Browse files
committed
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.
1 parent aa33441 commit 39e717f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void addClasspathEntries(IClasspathDescriptor classpath, IMavenProjectFacade fac
137137

138138
} else {
139139
File artifactFile = a.getFile();
140-
if(artifactFile != null /*&& artifactFile.canRead()*/) {
140+
if(artifactFile != null && artifactFile.exists()) {
141141
entry = classpath.addLibraryEntry(IPath.fromOSString(artifactFile.getAbsolutePath()));
142142
entry.setClasspathAttribute(IClasspathManager.TEST_ATTRIBUTE, addTestFlag ? "true" : null);
143143
}

0 commit comments

Comments
 (0)