Hi Arnaud,

it worked in both cases

thanks
Adrian

At 10/13/2005 01:25 PM, Arnaud HERITIER wrote:
Hi Adrian,

What you can do is to use the exec task from ant in your goal.
http://ant.apache.org/manual/CoreTasks/exec.html
In the NSIS plugin we called the nsis.exe with :
  <!--==================================================================-->
  <!-- Generate NSIS  .exe file                                         -->

<!--==================================================================-->
  <goal name="nsis:installer"
    description="Generate NSIS .exe file"
    prereqs="nsis:generate-project,nsis:generate-setup">

    <j:set var="script" value="${maven.build.dir}/setup.nsi"/>

    <util:file var="nsisExeFile" name="${maven.nsis.exe}" />
    <j:if test="${!nsisExeFile.exists()}">
      <fail>The NSIS executable '${maven.nsis.exe}' could not be found</fail>
    </j:if>

    <!-- call makensis.exe with the setup.nsi file -->
    <ant:exec executable="${maven.nsis.exe}" failonerror="true">
      <arg value="/V2"/>
      <arg value="${script}"/>
    </ant:exec>
<ant:echo>Installer ${maven.build.dir}/${maven.nsis.final.name}.exe generated successfully</ant:echo>
  </goal>

You can use properties defined in your build and environment properties (PATH, ..) with the property tag in ant :
  <property environment="env"/>
  <echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"/>
  <echo message="ANT_HOME is set to = ${env.ANT_HOME}"/>
http://ant.apache.org/manual/CoreTasks/property.html

Or you can simply call an ant script from maven with the ant:ant task.

Arnaud


> -----Message d'origine-----
> De : Adrian Zaharie [mailto:[EMAIL PROTECTED]
> Envoyé : mercredi 12 octobre 2005 22:36
> À : Maven Developers List; 'Maven Developers List'
> Objet : RE: run executable with args from maven.xml
>
> Hi Arnaud, thanks for your quick response
>
> what I want is similar to running, let's say echo.exe
> (windows) with one or more args directly from within
> maven.xml why? supposedly building directly from maven has
> extra info about the maven project tested, then running it
> from ant however, I called my ant build script from
> maven.xml, and it run succesfully program I want to run, is
> build on eclipse frame work, where I installed the maven plugin
>
> here is an example of what I would like to run:
> C:\>echo.exe %HOME% %TMP%
>
> In my case, I would also need to be able to specify the
> location to where the executable is located, where my test
> directory is, etc...
> I'm sure it's all the same
>
> questions:
> is there anything lost by calling the ant build script from
> maven.xml?  //I believe not is it possible to call an exe
> file directly from a maven.xml file, or does an ant build
> file need to be used? //so far this seems to be the case
>
> so in my case, all I care is to run the goal from maven;
> running the program will write a report for later
> examination; no conditions need to be evaluated
>
> thanks
> Adrian
>
> At 10/12/2005 12:57 PM, Arnaud HERITIER wrote:
> >Hi Adrian.
> >
> >Are you searching something like :
> >
> >     <exec dir="." executable="${maven.ssh.executable}"
> failonerror="true">
> >       <arg line="${maven.ssh.args} -l ${siteUsername}
> ${siteAddress}
> >'cd  ${maven.homepage} &amp;&amp; ${maven.site.gunzip.executable}
> >${maven.final.name}-site.tar.gz &amp;&amp;
> ${maven.site.tar.executable}
> >${maven.site.tar.options} ${maven.final.name}-site.tar
> &amp;&amp; chmod
> >${maven.site.chmod.options} ${maven.site.chmod.mode} * .
> &amp;&amp; rm
> >${maven.final.name}-site.tar'"/>
> >     </exec>
> >
> >You can take a look at the exec task in ant.
> >
> >Arnaud
> >
> >
> > > -----Message d'origine-----
> > > De : Adrian Zaharie [mailto:[EMAIL PROTECTED] Envoyé :
> mercredi 12
> > > octobre 2005 21:43 À : users@maven.apache.org;
> dev@maven.apache.org
> > > Objet : run executable with args from maven.xml
> > >
> > > I'm trying to run an executable (windows, script on linux) via
> > > maven.xml; program needs to take command line arguments;
> > >
> > > I'm looking for an example on how to do this; could not find
> > > anything in any docs, or examples except on calling built in
> > > functionality, or classes;
> > >
> > > could anyone send me an example or pointer to an example
> doing this
> > >
> > > here is what I need to do in my program 1. set some
> variables, and
> > > to program to execute 2. run the program
> > >
> > > thank you
> > >
> > > Adrian
> > >
> > >
> > >
> --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For
> > > additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional
> >commands, e-mail: [EMAIL PROTECTED]
>
>
>
> Regards,
>
> Adrian Zaharie
> ParaSoft Corporation
> (888) 305-0041 x 1229
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Regards,

Adrian Zaharie
ParaSoft Corporation
(888) 305-0041 x 1229

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to