Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java12
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingLifecyclePackaging.java42
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java13
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java3
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java2
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java19
-rw-r--r--org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java15
8 files changed, 6 insertions, 102 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java
index 69afc86f..ba00817c 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java
@@ -106,8 +106,6 @@ public interface IMavenConstants {
public static final String EDITOR_HINT_MISSING_CONFIGURATOR = "missing_configurator";
- public static final String EDITOR_HINT_UNKNOWN_PACKAGING = "unknown_packaging_type";
-
public static final String MARKER_COLUMN_START = "columnStart"; //$NON-NLS-1$
public static final String MARKER_COLUMN_END = "columnEnd"; //$NON-NLS-1$
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
index da880608..aa38b5dd 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
@@ -257,10 +257,6 @@ public class LifecycleMappingFactory {
lifecycleMappingMetadata = new LifecycleMappingMetadata();
lifecycleMappingMetadata.setLifecycleMappingId("DEFAULT"); // TODO proper constant
lifecycleMappingMetadata.setPackagingType(mavenProject.getPackaging());
-
- // TODO we don't need this marker
- SourceLocation markerLocation = SourceLocationHelper.findPackagingLocation(mavenProject);
- result.addProblem(new MissingLifecyclePackaging(mavenProject.getPackaging(), markerLocation));
}
result.setLifecycleMappingMetadata(lifecycleMappingMetadata);
@@ -389,12 +385,8 @@ public class LifecycleMappingFactory {
AbstractLifecycleMapping lifecycleMapping = null;
if(lifecycleMappingId != null) {
lifecycleMapping = getLifecycleMapping(lifecycleMappingId);
- }
- if(lifecycleMapping == null) {
- SourceLocation markerLocation = SourceLocationHelper.findPackagingLocation(mavenProject);
- if(lifecycleMappingId == null) {
- result.addProblem(new MissingLifecyclePackaging(mavenProject.getPackaging(), markerLocation));
- } else {
+ if(lifecycleMapping == null) {
+ SourceLocation markerLocation = SourceLocationHelper.findPackagingLocation(mavenProject);
result.addProblem(new MissingLifecycleExtensionPoint(lifecycleMappingId, markerLocation));
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingLifecyclePackaging.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingLifecyclePackaging.java
deleted file mode 100644
index b450de7b..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingLifecyclePackaging.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.internal.lifecyclemapping;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.osgi.util.NLS;
-
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.internal.Messages;
-import org.eclipse.m2e.core.internal.markers.SourceLocation;
-import org.eclipse.m2e.core.internal.markers.MavenProblemInfo;
-
-
-public class MissingLifecyclePackaging extends MavenProblemInfo {
- private final String packaging;
-
- MissingLifecyclePackaging(String packaging, SourceLocation markerLocation) {
- super(NLS.bind(Messages.LifecycleMissing, packaging), markerLocation);
- this.packaging = packaging;
- }
-
- public String getPackaging() {
- return packaging;
- }
-
- @Override
- public void processMarker(IMarker marker) throws CoreException {
- super.processMarker(marker);
- marker.setAttribute(IMavenConstants.MARKER_ATTR_PACKAGING, getPackaging());
- marker.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING);
- }
-}
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java
index ec41ed73..66569796 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/DiscoveryWizardProposal.java
@@ -49,10 +49,7 @@ public class DiscoveryWizardProposal extends WorkbenchMarkerResolution {
}
String type = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
- if(IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING.equals(type)) {
- MavenDiscovery.launchWizard(Collections.singleton(getPackageType(marker)), Collections.EMPTY_LIST,
- Collections.EMPTY_LIST, Collections.EMPTY_LIST);
- } else if(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(type)) {
+ if(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(type)) {
MavenDiscovery
.launchWizard(Collections.EMPTY_LIST, Collections.singleton(getMojoExecution(marker)), Collections.EMPTY_LIST, Collections.EMPTY_LIST);
} else if(IMavenConstants.EDITOR_HINT_UNKNOWN_LIFECYCLE_ID.equals(type)) {
@@ -79,9 +76,7 @@ public class DiscoveryWizardProposal extends WorkbenchMarkerResolution {
List<String> configuratorIds = new ArrayList<String>();
for(IMarker marker : markers) {
String type = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
- if(IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING.equals(type)) {
- packagingTypes.add(getPackageType(marker));
- } else if(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(type)) {
+ if(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(type)) {
mojos.add(getMojoExecution(marker));
} else if(IMavenConstants.EDITOR_HINT_UNKNOWN_LIFECYCLE_ID.equals(type)) {
lifecycleIds.add(getLifecycleId(marker));
@@ -106,10 +101,6 @@ public class DiscoveryWizardProposal extends WorkbenchMarkerResolution {
return null;
}
- private String getPackageType(IMarker marker) {
- return marker.getAttribute(IMavenConstants.MARKER_ATTR_PACKAGING, null);
- }
-
private String getLifecycleId(IMarker marker) {
return marker.getAttribute(IMavenConstants.MARKER_ATTR_LIFECYCLE_PHASE, null);
}
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java
index e7a06b0c..d34b376f 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/markers/MavenDiscoveryMarkerResolutionGenerator.java
@@ -48,8 +48,7 @@ public class MavenDiscoveryMarkerResolutionGenerator implements IMarkerResolutio
public static boolean canResolve(IMarker marker) {
String type = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
- return IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING.equals(type)
- || IMavenConstants.EDITOR_HINT_MISSING_CONFIGURATOR.equals(type)
+ return IMavenConstants.EDITOR_HINT_MISSING_CONFIGURATOR.equals(type)
|| IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(type)
|| IMavenConstants.EDITOR_HINT_UNKNOWN_LIFECYCLE_ID.equals(type);
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
index 7db71144..4105683d 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
@@ -121,8 +121,6 @@ public class PomQuickAssistProcessor implements IQuickAssistProcessor {
extractedFromMarkers(proposals, mark); //having this first sort of helps for 335490
proposals.add(new LifecycleMappingProposal(context, mark, PluginExecutionAction.ignore));
// proposals.add(new LifecycleMappingProposal(context, mark, PluginExecutionAction.execute));
- } else if (hint.equals(IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING)){
- extractedFromMarkers(proposals, mark);
}
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
index eee4baf6..0c99b2b7 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
@@ -104,24 +104,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
public void findLocationForMarker_(final IMarker marker) {
String hint = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
- if (IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING.equals(hint)) {
- try {
- XmlUtils.performOnRootElement((IFile)marker.getResource(), new NodeOperation<Element>() {
- public void process(Element root, IStructuredDocument structuredDocument) {
- Element markEl = findChild(root, "packaging");
- if (markEl == null) {
- markEl = root;
- }
- annotateMarker(marker, structuredDocument, markEl);
- }
- });
- } catch(IOException e) {
- log.error("Error locating marker", e);
- } catch(CoreException e) {
- log.error("Error locating marker", e);
- }
- }
-
+
if (IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(hint)) {
try {
XmlUtils.performOnRootElement((IFile)marker.getResource(), new NodeOperation<Element>() {
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
index 6bb96b5a..36a81f77 100644
--- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
+++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/WorkspaceHelpers.java
@@ -269,14 +269,6 @@ public class WorkspaceHelpers {
assertConfiguratorErrorMarkerAttributes(errorMarkers.get(0), configuratorId);
}
- public static void assertLifecyclePackagingErrorMarkerAttributes(IProject project, String packagingType)
- throws CoreException {
- List<IMarker> errorMarkers = WorkspaceHelpers.findErrorMarkers(project);
- Assert.assertNotNull(errorMarkers);
- Assert.assertEquals(WorkspaceHelpers.toString(errorMarkers), 1, errorMarkers.size());
- assertLifecyclePackagingErrorMarkerAttributes(errorMarkers.get(0), packagingType);
- }
-
public static void assertLifecycleIdErrorMarkerAttributes(IMarker marker, String lifecycleId) {
Assert.assertEquals("Marker's editor hint", IMavenConstants.EDITOR_HINT_UNKNOWN_LIFECYCLE_ID,
marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null));
@@ -291,13 +283,6 @@ public class WorkspaceHelpers {
marker.getAttribute(IMavenConstants.MARKER_ATTR_CONFIGURATOR_ID, null));
}
- public static void assertLifecyclePackagingErrorMarkerAttributes(IMarker marker, String packagingType) {
- Assert.assertEquals("Marker's editor hint", IMavenConstants.EDITOR_HINT_UNKNOWN_PACKAGING,
- marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null));
- Assert.assertEquals("Marker's packagingType", packagingType,
- marker.getAttribute(IMavenConstants.MARKER_ATTR_PACKAGING, null));
- }
-
public static void assertErrorMarkerAttributes(IMarker marker, MojoExecutionKey mojoExecution) {
Assert.assertEquals(IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION,
marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null));

Back to the top