Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2015-01-08 19:53:21 -0500
committerIgor Fedorenko2015-01-09 08:58:27 -0500
commit226d57bb04f23fd424764f4fed1d3e5db3e8f873 (patch)
treeb3d16ea9821f4ebbc1bebd0510e1dbba7a33b228
parent45ca9fab36221d34605f261dcdbbb0a6b3113b84 (diff)
downloadm2e-core-226d57bb04f23fd424764f4fed1d3e5db3e8f873.tar.gz
m2e-core-226d57bb04f23fd424764f4fed1d3e5db3e8f873.tar.xz
m2e-core-226d57bb04f23fd424764f4fed1d3e5db3e8f873.zip
457093 associate missing configurator errors/fixes with plugin executions
Change-Id: I88bb52ac44840e452d7dc688410e95edc4469780 Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java4
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingDiscoveryHelper.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties2
7 files changed, 26 insertions, 14 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
index 2e848b38..a84f5da9 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/lifecyclemapping/AggregateMappingLabelProvider.java
@@ -57,7 +57,9 @@ public class AggregateMappingLabelProvider implements ILifecycleMappingLabelProv
} else if(element instanceof PackagingTypeMappingRequirement) {
return NLS.bind("Packaging {0}", ((PackagingTypeMappingRequirement) element).getPackaging());
} else if(element instanceof ProjectConfiguratorMappingRequirement) {
- return NLS.bind("Connector {0}", ((ProjectConfiguratorMappingRequirement) element).getProjectConfiguratorId());
+ MojoExecutionKey exec = ((ProjectConfiguratorMappingRequirement) element).getExecution();
+ return NLS.bind("{0}:{1}:{2}",
+ new String[] {exec.getArtifactId(), exec.getVersion(), exec.getGoal(), String.valueOf(content.size())});
}
throw new IllegalStateException();
}
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingDiscoveryHelper.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingDiscoveryHelper.java
index b9bc0f71..aca713da 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingDiscoveryHelper.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingDiscoveryHelper.java
@@ -107,8 +107,9 @@ public class LifecycleMappingDiscoveryHelper {
}
} else if(IMavenConstants.EDITOR_HINT_MISSING_CONFIGURATOR.equals(type)) {
String configuratorId = getConfiguratorId(marker);
+ MojoExecutionKey mek = MarkerUtils.getMojoExecution(marker);
if(configuratorId != null) {
- requirement = new ProjectConfiguratorMappingRequirement(null, configuratorId);
+ requirement = new ProjectConfiguratorMappingRequirement(mek, configuratorId);
}
}
return requirement;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
index 7459abc7..336495e5 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java
@@ -77,6 +77,7 @@ import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.ILifecycleMappin
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.IMavenDiscoveryProposal;
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.LifecycleMappingDiscoveryRequest;
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.MojoExecutionMappingConfiguration.MojoExecutionMappingRequirement;
+import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.MojoExecutionMappingConfiguration.ProjectConfiguratorMappingRequirement;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.MavenImages;
@@ -295,8 +296,15 @@ public class LifecycleMappingPage extends WizardPage {
val.add(new ILifecycleMappingLabelProvider() {
public String getMavenText() {
+ String executionId = null;
if(requirement instanceof MojoExecutionMappingRequirement) {
- String executionId = ((MojoExecutionMappingRequirement) requirement).getExecutionId();
+ executionId = ((MojoExecutionMappingRequirement) requirement).getExecutionId();
+ } else if(requirement instanceof ProjectConfiguratorMappingRequirement) {
+ executionId = ((ProjectConfiguratorMappingRequirement) requirement).getExecution()
+ .getExecutionId();
+ }
+
+ if(executionId != null) {
if("default".equals(executionId)) {
return NLS.bind("{0}", relPath);
}
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 c096cbcd..f734d99d 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
@@ -735,11 +735,10 @@ public class LifecycleMappingFactory {
}
} catch(LifecycleMappingConfigurationException e) {
log.debug("Could not instantiate project configurator {}.", configuratorId, e);
- SourceLocation markerLocation = SourceLocationHelper.findLocation(mavenProject, executionKey);
- result.addProblem(new MissingConfiguratorProblemInfo(configuratorId, markerLocation));
if(reportNotCoveredMojoExecutionProblems) {
- result.addProblem(new NotCoveredMojoExecution(executionKey, notCoveredMojoExecutionSeverity
- .getSeverity(), markerLocation));
+ SourceLocation markerLocation = SourceLocationHelper.findLocation(mavenProject, executionKey);
+ result.addProblem(new MissingConfiguratorProblemInfo(configuratorId, executionKey,
+ notCoveredMojoExecutionSeverity.getSeverity(), markerLocation));
}
}
break;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java
index b5e58e48..2b6ffea5 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/MissingConfiguratorProblemInfo.java
@@ -17,15 +17,17 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.internal.Messages;
-import org.eclipse.m2e.core.internal.markers.MavenProblemInfo;
import org.eclipse.m2e.core.internal.markers.SourceLocation;
+import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
-public class MissingConfiguratorProblemInfo extends MavenProblemInfo {
+public class MissingConfiguratorProblemInfo extends MojoExecutionProblemInfo {
private final String configuratorId;
- public MissingConfiguratorProblemInfo(String configuratorId, SourceLocation markerLocation) {
- super(NLS.bind(Messages.ProjectConfiguratorNotAvailable, configuratorId), markerLocation);
+ public MissingConfiguratorProblemInfo(String configuratorId, MojoExecutionKey mojoExecutionKey, int severity,
+ SourceLocation markerLocation) {
+ super(NLS.bind(Messages.ProjectConfiguratorNotAvailable, configuratorId, mojoExecutionKey.toString()), severity,
+ mojoExecutionKey, markerLocation);
this.configuratorId = configuratorId;
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java
index 861d5525..095f2e1d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java
@@ -94,7 +94,7 @@ public class MojoExecutionMappingConfiguration implements ILifecycleMappingEleme
}
public static class ProjectConfiguratorMappingRequirement implements ILifecycleMappingRequirement {
- private final MojoExecutionKey execution; // only to make AggregateMappingLabelProvider happy. not part of the key
+ private final MojoExecutionKey execution;
private final String configuratorId;
@@ -118,7 +118,7 @@ public class MojoExecutionMappingConfiguration implements ILifecycleMappingEleme
ProjectConfiguratorMappingRequirement other = (ProjectConfiguratorMappingRequirement) obj;
- return configuratorId.equals(other.configuratorId);
+ return configuratorId.equals(other.configuratorId) && execution.equals(other.execution);
}
public MojoExecutionKey getExecution() {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
index 68f5f13e..465e2e29 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
@@ -28,7 +28,7 @@ LifecycleMappingPackagingMismatch=Packaging type {0} configured in embedded life
LifecycleMappingPluginVersionIncompatible=Incompatible lifecycle mapping plugin version {0}
PluginExecutionMappingDuplicate=Conflicting lifecycle mapping (plugin execution "{0}"). To enable full functionality, remove the conflicting mapping and run Maven->Update Project Configuration.
PluginExecutionMappingInvalid=Invalid plugin execution mapping (plugin execution "{0}"). To enable full functionality, correct the invalid mapping and run Maven->Update Project Configuration.
-ProjectConfiguratorNotAvailable=Project configurator "{0}" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration.
+ProjectConfiguratorNotAvailable=Project configurator "{0}" required by plugin execution "{1}" is not available. To enable full functionality, install the project configurator and run Maven->Update Project Configuration.
ProjectConfigurationUpdateRequired=Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix.
LocalProjectScanner_accessDeniedFromFolder=Can not access files from ''{0}''
LocalProjectScanner_task_scanning=Scanning folders

Back to the top