diff --git a/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/GradleBuildServerBuildSupport.java b/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/GradleBuildServerBuildSupport.java index 714130636..eeee66743 100644 --- a/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/GradleBuildServerBuildSupport.java +++ b/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/GradleBuildServerBuildSupport.java @@ -290,16 +290,16 @@ public void updateProjectDependencies(IProject project, IProgressMonitor monitor } IJavaProject javaProject = JavaCore.create(project); List classpath = new LinkedList<>(Arrays.asList(javaProject.getRawClasspath())); - classpath.addAll(getProjectDependencyEntries(projectDependencies)); + classpath.addAll(getProjectDependencyEntries(project, projectDependencies)); javaProject.setRawClasspath(classpath.toArray(IClasspathEntry[]::new), javaProject.getOutputLocation(), monitor); } - private List getProjectDependencyEntries(Set projectDependencies) { + private List getProjectDependencyEntries(IProject project, Set projectDependencies) { List entries = new LinkedList<>(); for (BuildTargetIdentifier dependency : projectDependencies) { URI uri = Utils.getUriWithoutQuery(dependency.getUri()); IProject dependencyProject = ProjectUtils.getProjectFromUri(uri.toString()); - if (dependencyProject != null) { + if (dependencyProject != null && !Objects.equals(project, dependencyProject)) { entries.add(JavaCore.newProjectEntry( dependencyProject.getFullPath(), ClasspathEntry.NO_ACCESS_RULES,