Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2013-05-05 12:07:26 -0400
committerFred Bricon2013-05-05 12:07:26 -0400
commit999f32aa09338c34503d9821a7678b5c2e0f4948 (patch)
treefce8c94506b14be17f50cb9138a1805430ecb84d
parent64bd67915551a5b13b9fc3844a154d63e17056d5 (diff)
downloadm2e-core-999f32aa09338c34503d9821a7678b5c2e0f4948.tar.gz
m2e-core-999f32aa09338c34503d9821a7678b5c2e0f4948.tar.xz
m2e-core-999f32aa09338c34503d9821a7678b5c2e0f4948.zip
361445 : add missing artifact GAVC as marker attributes
Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/IMavenConstants.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java19
2 files changed, 24 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/IMavenConstants.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/IMavenConstants.java
index 8c417d89..4591b921 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/IMavenConstants.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/IMavenConstants.java
@@ -89,6 +89,11 @@ public interface IMavenConstants {
public static final String MARKER_ATTR_VERSION = "version";//$NON-NLS-1$
+ /**
+ * @since 1.4.0
+ */
+ public static final String MARKER_ATTR_CLASSIFIER = "classifier";//$NON-NLS-1$
+
public static final String EDITOR_HINT_PARENT_GROUP_ID = "parent_groupid";//$NON-NLS-1$
public static final String EDITOR_HINT_PARENT_VERSION = "parent_version";//$NON-NLS-1$
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
index 130d79ce..243c31aa 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
@@ -11,10 +11,14 @@
package org.eclipse.m2e.core.internal.markers;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.osgi.util.NLS;
import org.sonatype.aether.artifact.Artifact;
+import org.eclipse.m2e.core.internal.IMavenConstants;
+
public class ArtifactNotFoundProblemInfo extends MavenProblemInfo {
private final Artifact artifact;
@@ -35,4 +39,19 @@ public class ArtifactNotFoundProblemInfo extends MavenProblemInfo {
public Artifact getArtifact() {
return this.artifact;
}
+
+ /**
+ * Adds the missing artifact groupId, artifactId, version and classifier as marker attributes.
+ *
+ * @since 1.4.0
+ */
+ public void processMarker(IMarker marker) throws CoreException {
+ super.processMarker(marker);
+ if(artifact != null) {
+ marker.setAttribute(IMavenConstants.MARKER_ATTR_GROUP_ID, artifact.getGroupId());
+ marker.setAttribute(IMavenConstants.MARKER_ATTR_ARTIFACT_ID, artifact.getArtifactId());
+ marker.setAttribute(IMavenConstants.MARKER_ATTR_VERSION, artifact.getVersion());
+ marker.setAttribute(IMavenConstants.MARKER_ATTR_CLASSIFIER, artifact.getClassifier());
+ }
+ }
}

Back to the top