Skip to content

Commit

Permalink
Only ever return pom path for type=pom
Browse files Browse the repository at this point in the history
This closes #1730
  • Loading branch information
kwin committed Apr 4, 2024
1 parent 5f94521 commit 0d1f99d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down

0 comments on commit 0d1f99d

Please sign in to comment.