Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for debug

  • Loading branch information...
commit 11132c4f5d064d6cc7f5d2a6c2c34aa2b9548ce6 1 parent 511970a
@digitalsanctum authored
View
39 src/main/java/de.akquinet.innovation.play.maven/Play2DebugMojo.java
@@ -0,0 +1,39 @@
+package de.akquinet.innovation.play.maven;
+
+import org.apache.commons.exec.CommandLine;
+import org.apache.commons.exec.DefaultExecutor;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.IOException;
+
+/**
+ * Launch the Play application in debug mode (play debug)
+ *
+ * @goal debug
+ * @requiresProject false
+ * @requiresDependencyResolution provided
+ */
+public class Play2DebugMojo extends AbstractPlay2Mojo {
+
+ public void execute() throws MojoExecutionException {
+
+ String line = getPlay2().getAbsolutePath();
+
+ CommandLine cmdLine = CommandLine.parse(line);
+
+ String[] args = {"debug", "run"};
+
+ cmdLine.addArguments(args);
+ DefaultExecutor executor = new DefaultExecutor();
+
+ // As where not linked to a project, we can't set the working directory.
+ // So it will use the directory where mvn was launched.
+
+ executor.setExitValue(0);
+ try {
+ executor.execute(cmdLine, getEnvironment());
+ } catch (IOException e) {
+ // Ignore.
+ }
+ }
+}
View
4 src/site/markdown/quickstart.md.vm
@@ -116,6 +116,10 @@ To package the application without running the tests:
mvn package -DskipTests
+To debug the application:
+
+ mvn play2:debug
+
Finally, to run the application:
mvn play2:run
Please sign in to comment.
Something went wrong with that request. Please try again.