Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-04-20 17:35:03 -0400
committerMatthew Piggott2011-04-20 17:35:23 -0400
commit9790d5d92a1722d284263b90221f5a06b246a4a6 (patch)
tree07df338e663d9bc999127c86dd5c92f6ac77f0a2
parent6bac8880fd4f0dfb83de5f641929d9ff7f918665 (diff)
downloadm2e-core-9790d5d92a1722d284263b90221f5a06b246a4a6.tar.gz
m2e-core-9790d5d92a1722d284263b90221f5a06b246a4a6.tar.xz
m2e-core-9790d5d92a1722d284263b90221f5a06b246a4a6.zip
Bug 342379 - Parent project selection should automatically fill relative path when parent is in workspace
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java10
2 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
index 64fa4fb6..e5882f9d 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java
@@ -198,9 +198,11 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
if(parentPage.isSimpleProject()) {
final Model model = artifactPage.getModel();
- //#335331 remove current model's version and groupId if equal to parent, to prevent showing a warning marker
if (model.getParent() != null) {
Parent par = model.getParent();
+ par.setRelativePath(location.makeRelativeTo(location.append(moduleName)).toOSString());
+
+ //#335331 remove current model's version and groupId if equal to parent, to prevent showing a warning marker
if (par.getGroupId() != null && par.getGroupId().equals(model.getGroupId())) {
model.setGroupId(null);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
index 56f81cca..8b30755e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
@@ -13,10 +13,9 @@ package org.eclipse.m2e.core.internal.project;
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -46,7 +45,6 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
@@ -160,10 +158,8 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
}
private void setHidden(IResource resource) {
- // Invoke IResource.setHidden() through reflection since it is only avaiable in Eclispe 3.4 & later
try {
- Method m = IResource.class.getMethod("setHidden", boolean.class); //$NON-NLS-1$
- m.invoke(resource, Boolean.TRUE);
+ resource.setHidden(true);
} catch (Exception ex) {
log.error("Failed to hide resource; " + resource.getLocation().toOSString(), ex);
}
@@ -475,6 +471,8 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
project.open(monitor);
monitor.worked(1);
+ hideNestedProjectsFromParents(Collections.singletonList(project));
+
monitor.worked(1);
monitor.subTask(Messages.ProjectConfigurationManager_task_creating_pom);

Back to the top