From 0d1f99dc3ca8af7b8faf96183ccf84f2a431d9ab Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Thu, 4 Apr 2024 21:07:55 +0200 Subject: [PATCH] Only ever return pom path for type=pom This closes #1730 --- .../registry/EclipseWorkspaceArtifactRepository.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java index d2605a6f20..cdac995348 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java @@ -25,7 +25,6 @@ import org.eclipse.aether.repository.WorkspaceRepository; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; -import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; @@ -77,8 +76,8 @@ protected File resolveAsEclipseProject(String groupId, String artifactId, String if(context.resolverConfiguration.isResolveWorkspaceProjects()) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IPath file = pom.getLocation(); - if(file == null) { + IPath pomFile = pom.getLocation(); + if(pomFile == null) { return ProjectRegistryManager.toJavaIoFile(pom); } if(!POM_EXTENSION.equals(extension)) { @@ -94,12 +93,13 @@ protected File resolveAsEclipseProject(String groupId, String artifactId, String if(location != null) { IResource res = root.findMember(location); if(res != null) { - file = res.getLocation(); + return res.getLocation().toFile(); } } + return null; + } else { + return pomFile.toFile(); } - - return file.toFile(); } return null;