Added mvn clean option under liberty in run configuration#572
Conversation
awisniew90
left a comment
There was a problem hiding this comment.
In the trace block starting on line 270 in StartTab.java - can you add the new clean option value to the print out?
awisniew90
left a comment
There was a problem hiding this comment.
Had one suggestion to have the --stop command as part of the same libertyDev command (if it works).
Also, I think the slight performance hit is OK given that the user is specifically requesting to do a clean start which probably wouldnt be done often.
| } else if (buildType == Project.BuildType.GRADLE) { | ||
| cmd = CommandBuilder.getGradleCommandLine(projectPath, "libertyDev " + startParms, pathEnv); | ||
| if (runProjectClean == true) { | ||
| // Step 1: Run gradle --stop |
There was a problem hiding this comment.
Can we have the gradle stop as part of the same command as the start? So for example:
./gradlew --stop && ./gradlew clean libertyDev or even ./graldew --stop clean libertyDev
Not sure if that last one will work, but the first should, I think. By running the process separately, we have a system process showing in the debug UI that seems a bit awkward:

awisniew90
left a comment
There was a problem hiding this comment.
Nice work - No longer seeing the gradle stop process attached to the Launch. Had some review comments
| } else { | ||
| command = Arrays.asList("/bin/sh", "-c", "./gradlew --stop"); | ||
| } | ||
| System.out.println("--stop command ::"+command); |
There was a problem hiding this comment.
We should remove these print statements. Instead you can use the Logger which will write to the plugin's log file.
| List<String> command; | ||
|
|
||
| if (Utils.isWindows()) { | ||
| command = Arrays.asList("cmd.exe", "/c", "gradlew.bat --stop"); |
There was a problem hiding this comment.
We need to resolve the Gradle executable the same way we do when running the dev mode command. This may or may not be a wrapper file.
| } | ||
| if (runProjectClean == true) { | ||
| stopGradleDaemon(projectPath); | ||
| } |
There was a problem hiding this comment.
There are a few spots where the formatting is off (use 4 spaces instead of Tab). You can run the formatter in Eclipse to fix.
| if (exitCode == 0 && output.toString().contains("Stopping Daemon")) { | ||
| System.out.println("Gradle daemon stopped successfully."); | ||
| } else { | ||
| System.err.println("Gradle --stop may have failed. Exit code: " + exitCode); |
There was a problem hiding this comment.
I'm thinking we can probably remove all of the print statements. These will show up in the plugin's log file (not in the console of the process), and most likely wont be seen. We can probably just have one error message (using Logger.logError() ) in case the stop of the daemon fails. e.g. "An attempt to stop the Gradle daemon failed...."
Fixes #239
changes includes :
Adding a new check box to enable project clean option under liberty in run configurations .
Test cases for the new Run project clean check box added for both Gradle and maven projects