Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-08-01 04:21:05 -0400
committerIgor Fedorenko2011-08-01 04:21:05 -0400
commitbfff4a0509d7ec9bdb813ca40e7bfb16372548f5 (patch)
treea3fe63a244e8ccd76cd7c6c996bc651823a05686 /org.eclipse.m2e.editor
parent74e41f5cadf4d515ccb47e38a8656a7b111ef457 (diff)
downloadm2e-core-bfff4a0509d7ec9bdb813ca40e7bfb16372548f5.tar.gz
m2e-core-bfff4a0509d7ec9bdb813ca40e7bfb16372548f5.tar.xz
m2e-core-bfff4a0509d7ec9bdb813ca40e7bfb16372548f5.zip
352411 - Dependency Hierarchy doesn't resolve dependencies from workspace
Use project workspace dependency resolution on/off configuration when calculating dependency hierarchy for main pom.xml files. Workspace dependency resolution is off for all other pom.xml files. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index 324f3bdb..aec564e3 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -38,6 +38,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
@@ -62,7 +63,6 @@ import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction.MavenPathStorageEditorInput;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction.MavenStorageEditorInput;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
import org.eclipse.m2e.editor.MavenEditorPlugin;
@@ -692,7 +692,14 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
log.error("Unable to read maven project. Dependencies not updated."); //$NON-NLS-1$
return null;
}
- DependencyNode root = MavenPlugin.getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor);
+
+ IMavenProjectFacade facade = null;
+ if(pomFile != null && new Path(IMavenConstants.POM_FILE_NAME).equals(pomFile.getProjectRelativePath())) {
+ facade = MavenPlugin.getMavenProjectRegistry().getProject(pomFile.getProject());
+ }
+
+ DependencyNode root = MavenPlugin.getMavenModelManager().readDependencyTree(facade, mavenProject, classpath,
+ monitor);
root.setData("LEVEL", "ROOT");
for (DependencyNode nd : root.getChildren()) {
nd.setData("LEVEL", "DIRECT");

Back to the top