diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-02-06 12:23:40 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-02-06 12:23:40 +0000 |
commit | 690119414dba0e8c0a20530e3f7d844dcd55c18b (patch) | |
tree | 4509b24c5a944ee6a50efa484dc1efc5ee933f7b /sca-java-2.x/trunk/maven | |
parent | c5bc0e870b6705c5e68568000cecadfa21b2c609 (diff) |
Update the Tuscany maven plugin to run the Shell so that it supports all the interactive shell commands from mvn tuscany:run
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1067646 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/maven')
-rw-r--r-- | sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml | 5 | ||||
-rw-r--r-- | sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml b/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml index 5a4d890a89..45d571d437 100644 --- a/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml +++ b/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml @@ -59,6 +59,11 @@ <artifactId>tuscany-domain-hazelcast</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
</dependencies>
diff --git a/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java b/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java index edb7e0f0de..7e3938d544 100644 --- a/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java +++ b/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java @@ -30,10 +30,11 @@ import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.shell.Shell;
/**
- * Maven Mojo to run the SCA contribution project in Tuscany.
+ * Maven Mojo to run the Tuscany Shell and install the project as an SCA contribution.
+ *
* Invoked with "mvn tuscany:run"
*
* @goal run
@@ -85,16 +86,17 @@ public class TuscanyRunMojo extends AbstractMojo { protected File finalName;
/**
- * @parameter expression="${config}" default-value="uri:default"
+ * @parameter expression="${config}" default-value="default"
*/
private String config;
+
/**
* @parameter expression="${contributions}"
*/
private String[] contributions;
public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().info("Starting Tuscany Runtime...");
+ getLog().info("Starting Tuscany Shell...");
List<String> contributionList = new ArrayList<String>();
@@ -102,9 +104,16 @@ public class TuscanyRunMojo extends AbstractMojo { addAdditionalContributions(contributionList);
- Node node = NodeFactory.newInstance(config).createNode((String)null, contributionList.toArray(new String[contributionList.size()])).start();
+ contributionList.add(0, config);
+
+ try {
+ Shell.main(contributionList.toArray(new String[contributionList.size()]));
+ } catch (Exception e) {
+ throw new MojoExecutionException("Exception in Shell", e);
+ }
- waitForShutdown(node, getLog());
+// waitForShutdown(new Ob, getLog());
+ getLog().info("Tuscany Shell stopped.");
}
private void addAdditionalContributions(List<String> contributionList) throws MojoExecutionException {
|