You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by yinhua <cn...@hotmail.com> on 2003/08/01 06:54:27 UTC

Re: how to start jboss in the ant

Thanks a lot for you and Tim Gordon.
And I have downloaded the apache-ant-1.6alpha-bin of 7/30/2003 from the
apache website. There is a option of spawn in the Exec. Can I use this
feature to start Jboss in the ant without blocking the build?

frank

----- Original Message ----- 
From: "Iwan" <ja...@i-ware.net>
To: "'Ant Users List'" <us...@ant.apache.org>
Sent: Wednesday, July 30, 2003 7:34 AM
Subject: RE: how to start jboss in the ant


> Here it is, I got it from the ant-mailinglist as well and was posted by
Tim
> Gordon, so we need to thank him for this excellent task.
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= TIM's POST START
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Lots of people seem to ask how to spawn a process that will live beyond
ANT.
> There are other ways, but this works for me... Don't rely on any console
> I/O, though - it's not piped in and whatever's piped out will cease to do
so
> once the ANT JVM exits. Generally intended for things that write logs,
have
> gui's, start their own shells, etc.
>
> Ruthlessly hacked from ExecTask, so it's a bit untidy. Works, though.
>
> eg:
>
>   <taskdef name="spawn" classname="tools.ant.Spawn"/>
>
>   <target name="startRmiRegistry">
>     <spawn executable="rmiregistry">
>       <arg value="${rmi.registry.port}"/>
>     </spawn>
>   </target>
>
> Usual path considerations apply.
>
> ----------------------
> import java.io.File;
> import java.io.FileOutputStream;
> import java.io.ByteArrayOutputStream;
> import java.io.IOException;
> import java.io.BufferedReader;
> import java.io.StringReader;
>
> import org.apache.tools.ant.Task;
> import org.apache.tools.ant.BuildException;
> import org.apache.tools.ant.Project;
> import org.apache.tools.ant.util.StringUtils;
> import org.apache.tools.ant.taskdefs.Execute;
> import org.apache.tools.ant.taskdefs.LogStreamHandler;
> import org.apache.tools.ant.types.Environment;
> import org.apache.tools.ant.types.Commandline;
>
> /**
>  * Spawns an asynchronous process from ANT
>  *
>  * @author Tim Gordon
>  */
> public class Spawn extends Task
> {
>   private String os;
>   private File out;
>   private File dir;
>   protected boolean newEnvironment = false;
>   private Environment env = new Environment();
>   protected Commandline cmdl = new Commandline();
>   private FileOutputStream fos = null;
>   private ByteArrayOutputStream baos = null;
>   private String outputprop;
>   private boolean failIfExecFails = true;
>   private boolean append = false;
>
>   /**
>    * Controls whether the VM (1.3 and above) is used to execute the
>    * command
>    */
>   private boolean vmLauncher = true;
>
>   /**
>    * The command to execute.
>    */
>   public void setExecutable(String value)
>   {
>     cmdl.setExecutable(value);
>   }
>
>   /**
>    * The working directory of the process.
>    */
>   public void setDir(File d)
>   {
>     this.dir = d;
>   }
>
>   /**
>    * List of operating systems on which the command may be executed.
>    */
>   public void setOs(String os)
>   {
>     this.os = os;
>   }
>
>   /**
>    * @ant.attribute ignore="true"
>    */
>   public void setCommand(Commandline cmdl)
>   {
>     log("The command attribute is deprecated. " +
>         "Please use the executable attribute and nested arg elements.",
>         Project.MSG_WARN);
>     this.cmdl = cmdl;
>   }
>
>   /**
>    * File the output of the process is redirected to.
>    */
>   public void setOutput(File out)
>   {
>     this.out = out;
>   }
>
>   /**
>    * Property name whose value should be set to the output of
>    * the process.
>    */
>   public void setOutputproperty(String outputprop)
>   {
>     this.outputprop = outputprop;
>   }
>
>   /**
>    * Do not propagate old environment when new environment variables are
> specified.
>    */
>   public void setNewenvironment(boolean newenv)
>   {
>     newEnvironment = newenv;
>   }
>
>   /**
>    * Add an environment variable to the launched process.
>    */
>   public void addEnv(Environment.Variable var)
>   {
>     env.addVariable(var);
>   }
>
>   /**
>    * Adds a command-line argument.
>    */
>   public Commandline.Argument createArg()
>   {
>     return cmdl.createArgument();
>   }
>
>   /**
>    * Stop the build if program cannot be started. Defaults to true.
>    *
>    * @since Ant 1.5
>    */
>   public void setFailIfExecutionFails(boolean flag)
>   {
>     failIfExecFails = flag;
>   }
>
>   /**
>    * Whether output should be appended to or overwrite an existing file.
>    * Defaults to false.
>    *
>    * @since 1.30, Ant 1.5
>    */
>   public void setAppend(boolean append)
>   {
>     this.append = append;
>   }
>
>   /**
>    * Do the work.
>    */
>   public void execute() throws BuildException
>   {
>     File savedDir = dir; // possibly altered in prepareExec
>     checkConfiguration();
>     if (isValidOs())
>     {
>       try
>       {
>         runExec(prepareExec());
>       }
>       finally
>       {
>         dir = savedDir;
>       }
>     }
>   }
>
>   /**
>    * Has the user set all necessary attributes?
>    */
>   protected void checkConfiguration() throws BuildException
>   {
>     if (cmdl.getExecutable() == null)
>     {
>       throw new BuildException("no executable specified", location);
>     }
>     if (dir != null && !dir.exists())
>     {
>       throw new BuildException("The directory you specified does not "
>                                + "exist");
>     }
>     if (dir != null && !dir.isDirectory())
>     {
>       throw new BuildException("The directory you specified is not a "
>                                + "directory");
>     }
>   }
>
>   /**
>    * Is this the OS the user wanted?
>    */
>   protected boolean isValidOs()
>   {
>     // test if os match
>     String myos = System.getProperty("os.name");
>     log("Current OS is " + myos, Project.MSG_VERBOSE);
>     if ((os != null) && (os.indexOf(myos) < 0))
>     {
>       // this command will be executed only on the specified OS
>       log("This OS, " + myos
>           + " was not found in the specified list of valid OSes: " + os,
>           Project.MSG_VERBOSE);
>       return false;
>     }
>     return true;
>   }
>
>   /**
>    * If true, launch new process with VM, otherwise use the OS's shell.
>    */
>   public void setVMLauncher(boolean vmLauncher)
>   {
>     this.vmLauncher = vmLauncher;
>   }
>
>   /**
>    * Create an Execute instance with the correct working directory set.
>    */
>   protected Execute prepareExec() throws BuildException
>   {
>     // default directory to the project's base directory
>     if (dir == null)
>     {
>       dir = project.getBaseDir();
>     }
>     Execute exe = new Execute(
>       new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)
>       {
>         public void stop()
>         {
>           // Just let the daemon threads handle output for the lifetime of
> this ANT invocation...
>         }
>       }
>     )
>     {
>       protected void waitFor(Process process)
>       {
>         // Don't want to wait for a detached process...
>       }
>     };
>
>     exe.setAntRun(getProject());
>     exe.setWorkingDirectory(dir);
>     exe.setVMLauncher(vmLauncher);
>     String[] environment = env.getVariables();
>     if (environment != null)
>     {
>       for (int i = 0; i < environment.length; i++)
>       {
>         log("Setting environment variable: " + environment[i],
>             Project.MSG_VERBOSE);
>       }
>     }
>     exe.setNewenvironment(newEnvironment);
>     exe.setEnvironment(environment);
>     return exe;
>   }
>
>   /**
>    * A Utility method for this classes and subclasses to run an
>    * Execute instance (an external command).
>    */
>   protected final void runExecute(Execute exe) throws IOException
>   {
>     exe.execute();
>
>     if (baos != null)
>     {
>       BufferedReader in =
>         new BufferedReader(new StringReader(Execute.toString(baos)));
>       String line = null;
>       StringBuffer val = new StringBuffer();
>       while ((line = in.readLine()) != null)
>       {
>         if (val.length() != 0)
>         {
>           val.append(StringUtils.LINE_SEP);
>         }
>         val.append(line);
>       }
>       project.setNewProperty(outputprop, val.toString());
>     }
>   }
>
>   /**
>    * Run the command using the given Execute instance. This may be
>    * overidden by subclasses
>    */
>   protected void runExec(Execute exe) throws BuildException
>   {
>     // show the command
>     log(cmdl.describeCommand(), Project.MSG_VERBOSE);
>
>     exe.setCommandline(cmdl.getCommandline());
>     try
>     {
>       runExecute(exe);
>     }
>     catch (IOException e)
>     {
>       if (failIfExecFails)
>       {
>         throw new BuildException("Execute failed: " + e.toString(), e,
>                                  location);
>       }
>       else
>       {
>         log("Execute failed: " + e.toString(), Project.MSG_ERR);
>       }
>     }
>     finally
>     {
>       // close the output file if required
>       logFlush();
>     }
>   }
>
>   /**
>    * Flush the output stream - if there is one.
>    */
>   protected void logFlush()
>   {
>     try
>     {
>       if (fos != null)
>       {
>         fos.close();
>       }
>       if (baos != null)
>       {
>         baos.close();
>       }
>     }
>     catch (IOException io)
>     {
>     }
>   }
> }
> -----------------
>
> Tim Gordon
>
> Allustra Limited
> 1 Royal Exchange Avenue
> London
> EC3V 3LT
> Tel 020 7464 4190
> Tel 020 7464 4194
> http://www.allustra.com/
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= TIM's POST END
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Iwan
>
> > -----Original Message-----
> > From: cnyinhua [mailto:cnyinhua@hotmail.com]
> > Sent: Wednesday, July 30, 2003 2:58 AM
> > To: 'Ant Users List'
> > Subject: RE: how to start jboss in the ant
> >
> >
> > Thanks, Iwan.
> > Where can I find the spawn task? I have checked the
> > apache-ant-1.6alpha, there is no spawn task in them. I'm a
> > little confused.
> >
> > -----Original Message-----
> > From: Iwan [mailto:java@i-ware.net]
> > Sent: 2003年7月29日 23:58
> > To: 'Ant Users List'
> > Subject: RE: how to start jboss in the ant
> >
> > Here's how I did it using the spawn-task that was posted recently.
> >
> >     <!--
> > ##############################################################
> > ######-->
> >     <!-- ############################ JBoss tasks
> > ###########################-->
> >     <!--
> > ##############################################################
> > ######-->
> >
> >     <!--
> > ===================================================================
> > -->
> >     <!-- Starts JBoss running the server ${jboss.host}
> > -->
> >     <!--
> > -->
> >     <!-- Specify the property jboss.new.process as 'start'
> > and jboss will
> > -->
> >     <!-- start in a new window.
> > -->
> >     <!--
> > ===================================================================
> > -->
> >     <target name="start.jboss" depends="check_jboss_running"
> > unless="jboss_already_running">
> >         <echo>+-----------------------------+</echo>
> >         <echo>|                             |</echo>
> >         <echo>| S T A R T I N G   J B O S S |</echo>
> >         <echo>|                             |</echo>
> >         <echo>+-----------------------------+</echo>
> >         <echo></echo>
> >         <echo>This will take some time, possibly up to a
> > minute.</echo>
> >         <echo></echo>
> >
> >   <!-- startJBoss.bat is some batch file that looks
> > like "%1 %2 %3 %4 %5", that's it. -->
> >   <!-- The first param is to either start Jboss'
> > run.bat directly or
> > thru the start   -->
> >   <!-- command from Windows, this is handled by the property
> > jboss.new.process   -->
> >         <spawn dir="${basedir}" executable="startJBoss.bat">
> >             <arg line="${jboss.new.process}
> > ${jboss.root.dir}/bin/run.bat -c ${jboss.server}"/>
> >         </spawn>
> >
> >   <!-- This property is used in the stop.jboss target
> > to identify
> > whether jboss was   -->
> >   <!-- started using this build script or not. You
> > might not want to stop jboss when  -->
> >   <!-- it wasn't started from the build script.
> > -->
> >         <property name="started_by_ant" value="true"/>
> >         <waitfor maxwait="60" maxwaitunit="second">
> >             <and>
> >                 <socket server="${jboss.host}" port="${jboss.port}"/>
> >                 <http
> > url="http://${jboss.host}:${jboss.port}/jmx-console/index.jsp"/>
> >             </and>
> >         </waitfor>
> >         <echo>+-----------------------------+</echo>
> >         <echo>| J B O S S   S T A R T E D   |</echo>
> >         <echo>+-----------------------------+</echo>
> >     </target>
> >
> >     <target name="check_jboss_running">
> >         <condition property="jboss_already_running" value="true">
> >             <and>
> >                 <socket server="${jboss.host}" port="${jboss.port}"/>
> >                 <http
> > url="http://${jboss.host}:${jboss.port}/jmx-console/index.jsp"/>
> >             </and>
> >         </condition>
> >         <echo>JBoss is already running on
> > ${jboss.host}:${jboss.port} - [${jboss_already_running}]</echo>
> >     </target>
> >
> >     <!--
> > ===================================================================
> > -->
> >     <!-- Stops JBoss running on the server ${jboss.host}
> > -->
> >     <!--
> > ===================================================================
> > -->
> >     <target name="stop.jboss" if="started_by_ant">
> >         <echo>+-----------------------------+</echo>
> >         <echo>|                             |</echo>
> >         <echo>| S T O P P I N G   J B O S S |</echo>
> >         <echo>|                             |</echo>
> >         <echo>+-----------------------------+</echo>
> >         <echo></echo>
> >         <spawn dir="${jboss.root.dir}\bin"
> > executable="${jboss.root.dir}\bin\shutdown.bat">
> >             <arg line="${jboss.host} ${jboss.port}"/>
> >         </spawn>
> >         <echo>+-----------------------------+</echo>
> >         <echo>| J B O S S   S T O P P E D   |</echo>
> >         <echo>+-----------------------------+</echo>
> >     </target>
> >
> >     <target name="fail.and.stop.jboss" if="jboss.timeout">
> >         <echo>+--------------------------+</echo>
> >         <echo>| J B O S S   F A I L E D  |</echo>
> >         <echo>+--------------------------+</echo>
> >         <antcall target="stop.jboss"/>
> >         <fail message="JBoss is not running correctly,
> > possibly due to a deployment error" if="jboss.timeout"/>
> >     </target>
> >
> > Iwan
> >
> > > -----Original Message-----
> > > From: yinhua [mailto:cnyinhua@hotmail.com]
> > > Sent: Wednesday, July 30, 2003 6:50 AM
> > > To: user@ant.apache.org
> > > Subject: how to start jboss in the ant
> > >
> > >
> > > hi, all
> > > I just want to start the JBoss in the ant build.xml, but I
> > > don't want to = use the Cactus. Does someboby know how to do
> > > this. I have heard of = Spawn, but I haven't seen this task
> > > in the ant build. How about this = one? Any help will be
> > > welcome. Thanks frank
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
----- Original Message -----
From: "yinhua" <cn...@hotmail.com>
Sent: Saturday, August 02, 2003 12:48 PM


> It is OK!
> I appreciate your help very much.  where can I find the detail information
> of the parameter for arg.
> frank.

In the manual, command line arguments are referred to as nested elements of
the exec task (and of the java task).

They are described at this location :

http://ant.apache.org/manual/using.html#arg

Antoine




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by yinhua <cn...@hotmail.com>.
It is OK!
I appreciate your help very much.  where can I find the detail information
of the parameter for arg.
frank.
----- Original Message ----- 
From: "Antoine Levy-Lambert" <an...@antbuild.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Friday, August 01, 2003 6:53 AM
Subject: Re: how to start jboss in the ant


> I have got in now - spawn will work if you redirect the output to NUL.
> exec executable="cmd" spawn="true">
>         <arg value="/C"/>
>         <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
>          <arg value=">NUL"/>
>  </exec>
>
> ----- Original Message -----
> From: "yinhua" <cn...@hotmail.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Saturday, August 02, 2003 6:46 AM
> Subject: Re: how to start jboss in the ant
>
>
> > <exec executable="cmd" spawn="true">
> >        <arg value="/C"/>
> >        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> > </exec>
> > Does this mean that I use spawn="true", that I can start the jboss
without
> > blocking the build process?
> > But the response on my PC is with spawn="false", it can start the jboss
> but
> > block.
> > And with thie spawn="true", there is no blocking of build.xml and it
> return
> > but jboss not started.
> > Is this right? I'm a little confused.
> > Any help will be welcome
> > Thx
> > frank
> > ----- Original Message -----
> > From: "Antoine Levy-Lambert" <an...@antbuild.com>
> > To: "Ant Users List" <us...@ant.apache.org>
> > Sent: Friday, August 01, 2003 12:04 AM
> > Subject: Re: how to start jboss in the ant
> >
> >
> > > something like this on UNIX
> > > (assuming the start script of JBoss is in Bourne-Shell, otherwishe
> > exchange
> > > sh for ksh or bash ...)
> > >
> > > <exec executable="sh" spawn="true">
> > >        <arg value="${path_to_jboss}/bin/start_jboss.sh"/>
> > > </exe>
> > >
> > >
> > > on Windows
> > >
> > > <exec executable="cmd" spawn="true">
> > >        <arg value="/C"/>
> > >        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> > > </exec>
> > >
> > > (I am not absolutely sure about cmd /C, but I know you have to give a
> > > special flag for cmd for this kind of stuff to work; please have a
look
> at
> > > cmd /? and study it yourself).
> > >
> > > Cheers,
> > >
> > > Antoine
> > >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
I have got in now - spawn will work if you redirect the output to NUL.
exec executable="cmd" spawn="true">
        <arg value="/C"/>
        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
         <arg value=">NUL"/>
 </exec>

----- Original Message -----
From: "yinhua" <cn...@hotmail.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, August 02, 2003 6:46 AM
Subject: Re: how to start jboss in the ant


> <exec executable="cmd" spawn="true">
>        <arg value="/C"/>
>        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> </exec>
> Does this mean that I use spawn="true", that I can start the jboss without
> blocking the build process?
> But the response on my PC is with spawn="false", it can start the jboss
but
> block.
> And with thie spawn="true", there is no blocking of build.xml and it
return
> but jboss not started.
> Is this right? I'm a little confused.
> Any help will be welcome
> Thx
> frank
> ----- Original Message -----
> From: "Antoine Levy-Lambert" <an...@antbuild.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Friday, August 01, 2003 12:04 AM
> Subject: Re: how to start jboss in the ant
>
>
> > something like this on UNIX
> > (assuming the start script of JBoss is in Bourne-Shell, otherwishe
> exchange
> > sh for ksh or bash ...)
> >
> > <exec executable="sh" spawn="true">
> >        <arg value="${path_to_jboss}/bin/start_jboss.sh"/>
> > </exe>
> >
> >
> > on Windows
> >
> > <exec executable="cmd" spawn="true">
> >        <arg value="/C"/>
> >        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> > </exec>
> >
> > (I am not absolutely sure about cmd /C, but I know you have to give a
> > special flag for cmd for this kind of stuff to work; please have a look
at
> > cmd /? and study it yourself).
> >
> > Cheers,
> >
> > Antoine
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.

> <exec executable="cmd" spawn="true">
>        <arg value="/C"/>
>        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> </exec>
> Does this mean that I use spawn="true", that I can start the jboss without
> blocking the build process?

Yes, spawn="true" is meant to start a process and not stop the build.


> But the response on my PC is with spawn="false", it can start the jboss
but
> block.


> And with the spawn="true", there is no blocking of build.xml and it return
> but jboss not started.

In this case this is a bug in this new attribute spawn.


I have jboss on my PC, so I will try this out.

Cheers,

Antoine



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by yinhua <cn...@hotmail.com>.
<exec executable="cmd" spawn="true">
       <arg value="/C"/>
       <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
</exec>
Does this mean that I use spawn="true", that I can start the jboss without
blocking the build process?
But the response on my PC is with spawn="false", it can start the jboss but
block.
And with thie spawn="true", there is no blocking of build.xml and it return
but jboss not started.
Is this right? I'm a little confused.
Any help will be welcome
Thx
frank
----- Original Message ----- 
From: "Antoine Levy-Lambert" <an...@antbuild.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Friday, August 01, 2003 12:04 AM
Subject: Re: how to start jboss in the ant


> something like this on UNIX
> (assuming the start script of JBoss is in Bourne-Shell, otherwishe
exchange
> sh for ksh or bash ...)
>
> <exec executable="sh" spawn="true">
>        <arg value="${path_to_jboss}/bin/start_jboss.sh"/>
> </exe>
>
>
> on Windows
>
> <exec executable="cmd" spawn="true">
>        <arg value="/C"/>
>        <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
> </exec>
>
> (I am not absolutely sure about cmd /C, but I know you have to give a
> special flag for cmd for this kind of stuff to work; please have a look at
> cmd /? and study it yourself).
>
> Cheers,
>
> Antoine
>
> ----- Original Message -----
> From: "yinhua" <cn...@hotmail.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Friday, August 01, 2003 2:50 PM
> Subject: Re: how to start jboss in the ant
>
>
> > Would you please give me a sample for this feature?
> > Thanx
> > ----- Original Message -----
> > From: "Antoine Levy-Lambert" <an...@antbuild.com>
> > To: "Ant Users List" <us...@ant.apache.org>
> > Sent: Thursday, July 31, 2003 6:57 AM
> > Subject: Re: how to start jboss in the ant
> >
> >
> > >
> > > ----- Original Message -----
> > > From: "yinhua" <cn...@hotmail.com>
> > > To: "Ant Users List" <us...@ant.apache.org>
> > > Sent: Friday, August 01, 2003 6:54 AM
> > > Subject: Re: how to start jboss in the ant
> > >
> > >
> > > > Thanks a lot for you and Tim Gordon.
> > > > And I have downloaded the apache-ant-1.6alpha-bin of 7/30/2003 from
> the
> > > > apache website. There is a option of spawn in the Exec. Can I use
this
> > > > feature to start Jboss in the ant without blocking the build?
> > > >
> > > > frank
> > > >
> > > Yes, the spawn option of exec should work.
> > > Cheers,
> > > Antoine
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
something like this on UNIX
(assuming the start script of JBoss is in Bourne-Shell, otherwishe exchange
sh for ksh or bash ...)

<exec executable="sh" spawn="true">
       <arg value="${path_to_jboss}/bin/start_jboss.sh"/>
</exe>


on Windows

<exec executable="cmd" spawn="true">
       <arg value="/C"/>
       <arg value="${path_to_jboss}/bin/start_jboss.bat"/>
</exec>

(I am not absolutely sure about cmd /C, but I know you have to give a
special flag for cmd for this kind of stuff to work; please have a look at
cmd /? and study it yourself).

Cheers,

Antoine

----- Original Message -----
From: "yinhua" <cn...@hotmail.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Friday, August 01, 2003 2:50 PM
Subject: Re: how to start jboss in the ant


> Would you please give me a sample for this feature?
> Thanx
> ----- Original Message -----
> From: "Antoine Levy-Lambert" <an...@antbuild.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Thursday, July 31, 2003 6:57 AM
> Subject: Re: how to start jboss in the ant
>
>
> >
> > ----- Original Message -----
> > From: "yinhua" <cn...@hotmail.com>
> > To: "Ant Users List" <us...@ant.apache.org>
> > Sent: Friday, August 01, 2003 6:54 AM
> > Subject: Re: how to start jboss in the ant
> >
> >
> > > Thanks a lot for you and Tim Gordon.
> > > And I have downloaded the apache-ant-1.6alpha-bin of 7/30/2003 from
the
> > > apache website. There is a option of spawn in the Exec. Can I use this
> > > feature to start Jboss in the ant without blocking the build?
> > >
> > > frank
> > >
> > Yes, the spawn option of exec should work.
> > Cheers,
> > Antoine
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by yinhua <cn...@hotmail.com>.
Would you please give me a sample for this feature? 
Thanx
----- Original Message ----- 
From: "Antoine Levy-Lambert" <an...@antbuild.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Thursday, July 31, 2003 6:57 AM
Subject: Re: how to start jboss in the ant


> 
> ----- Original Message ----- 
> From: "yinhua" <cn...@hotmail.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Friday, August 01, 2003 6:54 AM
> Subject: Re: how to start jboss in the ant
> 
> 
> > Thanks a lot for you and Tim Gordon.
> > And I have downloaded the apache-ant-1.6alpha-bin of 7/30/2003 from the
> > apache website. There is a option of spawn in the Exec. Can I use this
> > feature to start Jboss in the ant without blocking the build?
> > 
> > frank
> > 
> Yes, the spawn option of exec should work.
> Cheers,
> Antoine
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to start jboss in the ant

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
----- Original Message ----- 
From: "yinhua" <cn...@hotmail.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Friday, August 01, 2003 6:54 AM
Subject: Re: how to start jboss in the ant


> Thanks a lot for you and Tim Gordon.
> And I have downloaded the apache-ant-1.6alpha-bin of 7/30/2003 from the
> apache website. There is a option of spawn in the Exec. Can I use this
> feature to start Jboss in the ant without blocking the build?
> 
> frank
> 
Yes, the spawn option of exec should work.
Cheers,
Antoine

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org