Skip to content

Commit 0d1f99d

Browse files
committed
Only ever return pom path for type=pom
This closes #1730
1 parent 5f94521 commit 0d1f99d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.eclipse.aether.repository.WorkspaceRepository;
2626
import org.eclipse.aether.util.version.GenericVersionScheme;
2727
import org.eclipse.aether.version.InvalidVersionSpecificationException;
28-
import org.eclipse.aether.version.Version;
2928
import org.eclipse.aether.version.VersionConstraint;
3029
import org.eclipse.core.resources.IFile;
3130
import org.eclipse.core.resources.IResource;
@@ -77,8 +76,8 @@ protected File resolveAsEclipseProject(String groupId, String artifactId, String
7776

7877
if(context.resolverConfiguration.isResolveWorkspaceProjects()) {
7978
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
80-
IPath file = pom.getLocation();
81-
if(file == null) {
79+
IPath pomFile = pom.getLocation();
80+
if(pomFile == null) {
8281
return ProjectRegistryManager.toJavaIoFile(pom);
8382
}
8483
if(!POM_EXTENSION.equals(extension)) {
@@ -94,12 +93,13 @@ protected File resolveAsEclipseProject(String groupId, String artifactId, String
9493
if(location != null) {
9594
IResource res = root.findMember(location);
9695
if(res != null) {
97-
file = res.getLocation();
96+
return res.getLocation().toFile();
9897
}
9998
}
99+
return null;
100+
} else {
101+
return pomFile.toFile();
100102
}
101-
102-
return file.toFile();
103103
}
104104

105105
return null;

0 commit comments

Comments
 (0)