Good one! On Sun, Feb 6, 2011 at 2:23 PM, <antel...@apache.org> wrote:
> Author: antelder > Date: Sun Feb 6 12:23:40 2011 > New Revision: 1067646 > > URL: http://svn.apache.org/viewvc?rev=1067646&view=rev > Log: > Update the Tuscany maven plugin to run the Shell so that it supports all > the interactive shell commands from mvn tuscany:run > > Modified: > tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml > > > tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java > > Modified: tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml > URL: > http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml?rev=1067646&r1=1067645&r2=1067646&view=diff > > ============================================================================== > --- tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml > (original) > +++ tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/pom.xml Sun Feb > 6 12:23:40 2011 > @@ -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> > > > Modified: > tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java > URL: > http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java?rev=1067646&r1=1067645&r2=1067646&view=diff > > ============================================================================== > --- > tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java > (original) > +++ > tuscany/sca-java-2.x/trunk/maven/maven-tuscany-plugin/src/main/java/org/apache/tuscany/maven/plugin/TuscanyRunMojo.java > Sun Feb 6 12:23:40 2011 > @@ -30,10 +30,11 @@ import org.apache.maven.plugin.MojoFailu > 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 Abst > 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 Abst > > 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 { > > >