Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-09-09 10:42:32 -0400
committerIgor Fedorenko2011-09-09 10:42:32 -0400
commit62a26d5fbbd0b1be3c7a410f58fb573c79cd15e4 (patch)
treebf918d839fc60cb98ce64b3061829fdaefa5c9f9
parent133a9bad606ced21d81c4eecfc83baa18229c300 (diff)
parent4ca16a591d79e47a4f56d5a7b2886b9814110ba0 (diff)
downloadm2e-core-62a26d5fbbd0b1be3c7a410f58fb573c79cd15e4.tar.gz
m2e-core-62a26d5fbbd0b1be3c7a410f58fb573c79cd15e4.tar.xz
m2e-core-62a26d5fbbd0b1be3c7a410f58fb573c79cd15e4.zip
Merge branch 'master' into m2e-self-hosting
Conflicts: org.eclipse.m2e.usagedata/build.properties
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenModuleWizard.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java17
-rw-r--r--org.eclipse.m2e.editor/META-INF/MANIFEST.MF8
-rw-r--r--org.eclipse.m2e.editor/build.properties1
4 files changed, 23 insertions, 8 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 43d50662..67452eb6 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
@@ -203,7 +203,10 @@ public class MavenModuleWizard extends AbstractMavenProjectWizard implements INe
final Model model = artifactPage.getModel();
if (model.getParent() != null) {
Parent par = model.getParent();
- par.setRelativePath(location.makeRelativeTo(location.append(moduleName)).toOSString());
+ String relPath = location.makeRelativeTo(location.append(moduleName)).toOSString();
+ if(!"..".equals(relPath)) { //$NON-NLS-1$
+ par.setRelativePath(relPath);
+ }
//#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())) {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
index 1878930b..cc3c1c1e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
@@ -36,8 +36,9 @@ import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+
/**
- * Maintains map file of maven artifacts present in workspace.
+ * Maintains map file of maven artifacts present in workspace.
*/
public class WorkspaceStateWriter implements IMavenProjectChangedListener {
private static final Logger log = LoggerFactory.getLogger(WorkspaceStateWriter.class);
@@ -47,13 +48,18 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
public WorkspaceStateWriter(MavenProjectManager projectManager) {
this.projectManager = projectManager;
}
-
+
public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
try {
Properties state = new Properties();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
for(IMavenProjectFacade projectFacade : projectManager.getProjects()) {
+ if(!projectFacade.getProject().isAccessible()) {
+ log.debug("Project registry contains closed project {}", projectFacade.getProject());
+ // this is actually a bug somewhere in registry refresh logic, closed projects should not be there
+ continue;
+ }
try {
Artifact artifact = projectFacade.getMavenProject(monitor).getArtifact();
IFile pomFile = projectFacade.getPom();
@@ -66,12 +72,13 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
}
}
IResource outputLocation = root.findMember(projectFacade.getOutputLocation());
- if (!"pom".equals(artifact.getType()) && outputLocation != null && outputLocation.exists()) { //$NON-NLS-1$
+ if(!"pom".equals(artifact.getType()) && outputLocation != null && outputLocation.exists()) { //$NON-NLS-1$
String extension = artifact.getArtifactHandler().getExtension();
- String key = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + extension + ":" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String key = artifact.getGroupId()
+ + ":" + artifact.getArtifactId() + ":" + extension + ":" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
state.put(key, outputLocation.getLocation().toFile().getCanonicalPath());
}
- } catch (CoreException ex) {
+ } catch(CoreException ex) {
log.error("Error writing workspace state file", ex);
}
}
diff --git a/org.eclipse.m2e.editor/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF
index 93d57382..00ae48b5 100644
--- a/org.eclipse.m2e.editor/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF
@@ -13,13 +13,17 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.wst.sse.core,
org.eclipse.wst.sse.ui,
org.eclipse.wst.xml.core,
- org.eclipse.emf.edit.ui;resolution:=optional,
+ org.eclipse.ui.workbench,
org.eclipse.m2e.core;bundle-version="[1.0.0,1.1.0)",
org.eclipse.m2e.maven.runtime;bundle-version="[1.0.0,1.1.0)",
org.eclipse.m2e.editor.xml;bundle-version="[1.0.0,1.1.0)",
org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.1.0)",
org.slf4j.api;bundle-version="1.6.1",
- org.eclipse.wst.common.emf
+ org.eclipse.wst.common.emf,
+ org.eclipse.swt,
+ org.eclipse.jface,
+ org.eclipse.emf.common,
+ org.eclipse.emf.ecore
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
diff --git a/org.eclipse.m2e.editor/build.properties b/org.eclipse.m2e.editor/build.properties
index 11e00027..d70d4164 100644
--- a/org.eclipse.m2e.editor/build.properties
+++ b/org.eclipse.m2e.editor/build.properties
@@ -19,3 +19,4 @@ bin.includes = plugin.xml,\
schema/,\
OSGI-INF/l10n/bundle.properties,\
about.html
+jars.extra.classpath=platform:/plugin/org.eclipse.emf.edit.ui

Back to the top