@@ -81,6 +81,18 @@ public class DevModeOperations {
81
81
"stopJobCompletionOutput" );
82
82
private Map <Job , Boolean > runningJobs = new ConcurrentHashMap <Job , Boolean >();
83
83
84
+ /** Default Maven devc command */
85
+ public static final String DEFAULT_MAVEN_DEVC = "io.openliberty.tools:liberty-maven-plugin:devc" ;
86
+
87
+ /** Default Maven dev command */
88
+ public static final String DEFAULT_MAVEN_DEV = "io.openliberty.tools:liberty-maven-plugin:dev" ;
89
+
90
+ /** Default Gradle devc command */
91
+ public static final String DEFAULT_GRADLE_DEVC = "libertyDevc" ;
92
+
93
+ /** Default Gradle dev command */
94
+ public static final String DEFAULT_GRADLE_DEV = "libertyDev" ;
95
+
84
96
/**
85
97
* Project terminal tab controller instance.
86
98
*/
@@ -149,10 +161,10 @@ public static DevModeOperations getInstance() {
149
161
* @param javaHomePath The configuration java installation home to be set in the terminal running dev mode.
150
162
* @param mode The configuration mode.
151
163
*/
152
- public void start (IProject iProject , String preStartGoals , String parms , String javaHomePath , String mode ) {
164
+ public void start (IProject iProject , String launchCommand , String javaHomePath , String mode ) {
153
165
154
166
if (Trace .isEnabled ()) {
155
- Trace .getTracer ().traceEntry (Trace .TRACE_TOOLS , new Object [] { iProject , preStartGoals , parms , javaHomePath , mode });
167
+ Trace .getTracer ().traceEntry (Trace .TRACE_TOOLS , new Object [] { iProject , launchCommand , javaHomePath , mode });
156
168
}
157
169
158
170
if (iProject == null ) {
@@ -207,28 +219,21 @@ public void start(IProject iProject, String preStartGoals, String parms, String
207
219
throw new Exception ("Unable to find the path to selected project " + projectName );
208
220
}
209
221
210
- String userPreStartGoals = (preStartGoals == null ) ? "" : preStartGoals .trim ();
211
-
212
- // If in debug mode, adjust the start parameters.
213
- String userParms = (parms == null ) ? "" : parms .trim ();
214
- String startParms = null ;
215
222
String debugPort = null ;
216
223
if (ILaunchManager .DEBUG_MODE .equals (mode )) {
217
- debugPort = debugModeHandler .calculateDebugPort (project , userParms );
218
- startParms = debugModeHandler .addDebugDataToStartParms (project , debugPort , userParms );
219
- } else {
220
- startParms = userParms ;
224
+ debugPort = debugModeHandler .calculateDebugPort (project , launchCommand );
225
+ launchCommand = debugModeHandler .addDebugDataToStartParms (project , debugPort , launchCommand );
221
226
}
222
227
223
228
// Prepare the Liberty plugin container dev mode command.
224
229
String cmd = "" ;
225
230
BuildType buildType = project .getBuildType ();
226
231
if (buildType == Project .BuildType .MAVEN ) {
227
- cmd = CommandBuilder .getMavenCommandLine (projectPath , userPreStartGoals .trim () +
228
- " io.openliberty.tools:liberty-maven-plugin:dev " + startParms ,
232
+ cmd = CommandBuilder .getMavenCommandLine (projectPath , launchCommand ,
229
233
pathEnv , true );
230
234
} else if (buildType == Project .BuildType .GRADLE ) {
231
- cmd = CommandBuilder .getGradleCommandLine (projectPath , "libertyDev " + startParms , pathEnv , true );
235
+ cmd = CommandBuilder .getGradleCommandLine (projectPath , launchCommand ,
236
+ pathEnv , true );
232
237
} else {
233
238
throw new Exception ("Unexpected project build type: " + buildType + ". Project " + projectName
234
239
+ "does not appear to be a Maven or Gradle built project." );
@@ -265,14 +270,14 @@ public void start(IProject iProject, String preStartGoals, String parms, String
265
270
* Starts the Liberty server in dev mode in a container.
266
271
*
267
272
* @param iProject The project instance to associate with this action.
268
- * @param parms The configuration parameters to be used when starting dev mode.
273
+ * @param launchCommand The configuration launch comand to be used when starting dev mode.
269
274
* @param javaHomePath The configuration java installation home to be set in the terminal running dev mode.
270
275
* @param mode The configuration mode.
271
276
*/
272
- public void startInContainer (IProject iProject , String preStartGoals , String parms , String javaHomePath , String mode ) {
277
+ public void startInContainer (IProject iProject , String launchCommand , String javaHomePath , String mode ) {
273
278
274
279
if (Trace .isEnabled ()) {
275
- Trace .getTracer ().traceEntry (Trace .TRACE_TOOLS , new Object [] { iProject , parms , javaHomePath , mode });
280
+ Trace .getTracer ().traceEntry (Trace .TRACE_TOOLS , new Object [] { iProject , launchCommand , javaHomePath , mode });
276
281
}
277
282
278
283
if (iProject == null ) {
@@ -328,25 +333,19 @@ public void startInContainer(IProject iProject, String preStartGoals, String par
328
333
}
329
334
330
335
// If in debug mode, adjust the start parameters.
331
- String userParms = (parms == null ) ? "" : parms .trim ();
332
- String startParms = null ;
333
336
String debugPort = null ;
334
337
if (ILaunchManager .DEBUG_MODE .equals (mode )) {
335
- debugPort = debugModeHandler .calculateDebugPort (project , userParms );
336
- startParms = debugModeHandler .addDebugDataToStartParms (project , debugPort , userParms );
337
- } else {
338
- startParms = userParms ;
338
+ debugPort = debugModeHandler .calculateDebugPort (project , launchCommand );
339
+ launchCommand = debugModeHandler .addDebugDataToStartParms (project , debugPort , launchCommand );
339
340
}
340
341
341
342
// Prepare the Liberty plugin container dev mode command.
342
343
String cmd = "" ;
343
344
BuildType buildType = project .getBuildType ();
344
345
if (buildType == Project .BuildType .MAVEN ) {
345
- cmd = CommandBuilder .getMavenCommandLine (projectPath ,
346
- preStartGoals .trim () + " io.openliberty.tools:liberty-maven-plugin:devc " + startParms ,
347
- pathEnv , true );
346
+ cmd = CommandBuilder .getMavenCommandLine (projectPath , launchCommand , pathEnv , true );
348
347
} else if (buildType == Project .BuildType .GRADLE ) {
349
- cmd = CommandBuilder .getGradleCommandLine (projectPath , "libertyDevc " + startParms , pathEnv , true );
348
+ cmd = CommandBuilder .getGradleCommandLine (projectPath , launchCommand , pathEnv , true );
350
349
} else {
351
350
throw new Exception ("Unexpected project build type: " + buildType + ". Project " + projectName
352
351
+ "does not appear to be a Maven or Gradle built project." );
0 commit comments