Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
index 38dec65f..51cedc74 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -71,11 +71,14 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
private List<IMavenLaunchParticipant> participants;
+ private String programArguments;
+
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
throws CoreException {
this.launch = launch;
this.monitor = monitor;
this.participants = getParticipants(configuration, launch);
+ this.programArguments = null;
log.info("" + getWorkingDirectory(configuration)); //$NON-NLS-1$
log.info(" mvn" + getProgramArguments(configuration)); //$NON-NLS-1$
@@ -159,19 +162,21 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
}
public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
- StringBuilder sb = new StringBuilder();
- sb.append(getProperties(configuration));
- sb.append(" ").append(getPreferences(configuration));
- sb.append(" ").append(getGoals(configuration));
-
- for(IMavenLaunchParticipant participant : participants) {
- String programArguments = participant.getProgramArguments(configuration, launch, monitor);
- if(programArguments != null) {
- sb.append(" ").append(programArguments);
+ if(programArguments == null) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getProperties(configuration));
+ sb.append(" ").append(getPreferences(configuration));
+ sb.append(" ").append(getGoals(configuration));
+
+ for(IMavenLaunchParticipant participant : participants) {
+ String programArguments = participant.getProgramArguments(configuration, launch, monitor);
+ if(programArguments != null) {
+ sb.append(" ").append(programArguments);
+ }
}
+ programArguments = sb.toString();
}
-
- return sb.toString();
+ return programArguments;
}
public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {

Back to the top