Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Windszus2015-08-03 03:43:51 -0400
committerFred Bricon2015-09-01 18:54:17 -0400
commite99894eec5f030d6b955d9f13da1f45f953cfb4e (patch)
tree8dfd68de5ec9006690b830b030167867f26f20eb
parentc051719deda066a6157a3d85a6351f8d82818f54 (diff)
downloadm2e-core-e99894eec5f030d6b955d9f13da1f45f953cfb4e.tar.gz
m2e-core-e99894eec5f030d6b955d9f13da1f45f953cfb4e.tar.xz
m2e-core-e99894eec5f030d6b955d9f13da1f45f953cfb4e.zip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=472064
Support skipping invalid launch configurations Change-Id: I80e2ff3d1e2cb79ea94664143e8b1b9b8b2d476e Signed-off-by: Konrad Windszus <konrad_w@gmx.de>
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
index 8045d748..1711ac6b 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
@@ -286,16 +286,21 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
ArrayList<ILaunchConfiguration> matchingConfigs = new ArrayList<ILaunchConfiguration>();
for(ILaunchConfiguration configuration : launchConfigurations) {
- // substitute variables
- String workDir = LaunchingUtils.substituteVar(configuration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR,
- (String) null));
- if(workDir == null) {
- continue;
- }
- IPath workPath = new Path(workDir);
- if(basedirLocation.equals(workPath)) {
- matchingConfigs.add(configuration);
+ try {
+ // substitute variables (may throw exceptions)
+ String workDir = LaunchingUtils.substituteVar(configuration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR,
+ (String) null));
+ if(workDir == null) {
+ continue;
+ }
+ IPath workPath = new Path(workDir);
+ if(basedirLocation.equals(workPath)) {
+ matchingConfigs.add(configuration);
+ }
+ } catch(CoreException e) {
+ log.error("Skipping launch configuration {}", configuration.getName(), e);
}
+
}
if(matchingConfigs.size() == 1) {

Back to the top