You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by veena pandit <v....@gmail.com> on 2009/09/01 00:47:02 UTC

Re: Basic question about ant

Since wsgen is in a jar file,  I put the complete path of the jar file in
the exec.
So if anttasks.jar was in C:/eclipse/plugins/anttasks.jar then my exec looks
like this:

<exec executable="C:/eclipse/plugins/wsgen">

On Mon, Aug 31, 2009 at 1:01 PM, Gilbert Rebhan <an...@schillbaer.de> wrote:

> veena pandit schrieb:
> > Hi,
> >
> > I was able to fix the environment variable and run ant from the command
> > line.  I tried the things you listed below but from eclipse it still
> gives
> > me an error saying it does not recognize the program wsgen.
> >
>
> did you try the absolute path, f.e.
>
> ...
> <exec executable="C:/whatever/path/to/wsgen">
> ...
>
> ??
>
> gives us a snippet with your latest try
>
>
>
> Regards, Gilbert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

RE: Basic question about ant

Posted by Martin Gainty <mg...@hotmail.com>.
you'll want try to locate the main class of the jar

cd SomeFolder
jar -xvf wsgen.jar 

cd SomeFolder
javap *.class | grep main

//when you see a 'main' method in one of the classes 
//then assign the main class to classname attribute of taskdef as described here
<taskdef name="global"
           classname="package.ClassWithMain">
    <classpath refid="testclasses" />
  </taskdef>

//now you can call the task from a target
<target name="testGlobal">
    <global>
      <echo message="it worked!" />
    </global>
  </target>

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Mon, 31 Aug 2009 18:47:02 -0400
> Subject: Re: Basic question about ant
> From: v.kris21@gmail.com
> To: user@ant.apache.org
> 
> Since wsgen is in a jar file,  I put the complete path of the jar file in
> the exec.
> So if anttasks.jar was in C:/eclipse/plugins/anttasks.jar then my exec looks
> like this:
> 
> <exec executable="C:/eclipse/plugins/wsgen">
> 
> On Mon, Aug 31, 2009 at 1:01 PM, Gilbert Rebhan <an...@schillbaer.de> wrote:
> 
> > veena pandit schrieb:
> > > Hi,
> > >
> > > I was able to fix the environment variable and run ant from the command
> > > line.  I tried the things you listed below but from eclipse it still
> > gives
> > > me an error saying it does not recognize the program wsgen.
> > >
> >
> > did you try the absolute path, f.e.
> >
> > ...
> > <exec executable="C:/whatever/path/to/wsgen">
> > ...
> >
> > ??
> >
> > gives us a snippet with your latest try
> >
> >
> >
> > Regards, Gilbert
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >

_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009

Re: Basic question about ant

Posted by veena pandit <v....@gmail.com>.
* I tried build again and wsgen works.  I haven't done any of the steps
below.*
*This is after I added ant to the path.  and set ANT_HOME yesterday.*
*Today wsgen works.*

**
Thanks to all the people who helped.

Veena


On Tue, Sep 1, 2009 at 3:44 AM, Rebhan, Gilbert <
Gilbert.Rebhan@huk-coburg.de> wrote:

>
>
> -----Original Message-----
> From: veena pandit [mailto:v.kris21@gmail.com]
> Sent: Tuesday, September 01, 2009 12:47 AM
> To: Ant Users List
> Subject: Re: Basic question about ant
>
> /*
> Since wsgen is in a jar file,  I put the complete path of the jar file in
> the exec.
> So if anttasks.jar was in C:/eclipse/plugins/anttasks.jar then my exec
> looks
> like this:
>
> <exec executable="C:/eclipse/plugins/wsgen">
> */
>
> since your wsgen task comes with a jar, don't use the exec task,
> but i should be as easy as =
>
> use taskdef with path =
>  <taskdef resource="com.whatever.wsgen.TheClassYouNeedToCall">
>    <classpath path="C:/wsgen/wsgentask.jar" />
>  </taskdef>
>
> or if it's a tasksuite where wsgen is part of =
> use taskdef with path =
>  <taskdef resource="com/whatever/antlib.xml">
>    <classpath path="C:/wsgen/wstasks.jar" />
>  </taskdef>
>
>
> add the wsgentask.jar to the (eclipse) antruntime via
> Window | Preferences | Ant | Runtime | Global Entries |
>  and either
>   Add Jars if you have a project in your workspace
>   that contains your wsgentask.jar (personally i prefer to
>    have a simple project named DevJars in my workspace
>    which has all the jars i need, which is also under cvs control)
>   or
>   Add External Jars to use a wsgentask.jar that lives
>   in filesytem outside eclkipse workspace
>
> you will also have code assist for your tasks in ant editor then
>
> when put to ant runtime you don't need the nested classpath =
> <taskdef resource="com.whatever.wsgen.TheClassYouNeedToCall"/>
> or
> <taskdef resource="com/whatever/antlib.xml"/>
>
>
> Regards, Gilbert
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

RE: Basic question about ant

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 

-----Original Message-----
From: veena pandit [mailto:v.kris21@gmail.com] 
Sent: Tuesday, September 01, 2009 12:47 AM
To: Ant Users List
Subject: Re: Basic question about ant

/*
Since wsgen is in a jar file,  I put the complete path of the jar file in
the exec.
So if anttasks.jar was in C:/eclipse/plugins/anttasks.jar then my exec looks
like this:

<exec executable="C:/eclipse/plugins/wsgen">
*/

since your wsgen task comes with a jar, don't use the exec task,
but i should be as easy as =

use taskdef with path =
  <taskdef resource="com.whatever.wsgen.TheClassYouNeedToCall">
    <classpath path="C:/wsgen/wsgentask.jar" />
  </taskdef>

or if it's a tasksuite where wsgen is part of =
use taskdef with path =
  <taskdef resource="com/whatever/antlib.xml">
    <classpath path="C:/wsgen/wstasks.jar" />
  </taskdef>


add the wsgentask.jar to the (eclipse) antruntime via
Window | Preferences | Ant | Runtime | Global Entries |
 and either
   Add Jars if you have a project in your workspace
   that contains your wsgentask.jar (personally i prefer to
    have a simple project named DevJars in my workspace
    which has all the jars i need, which is also under cvs control)
   or
   Add External Jars to use a wsgentask.jar that lives
   in filesytem outside eclkipse workspace

you will also have code assist for your tasks in ant editor then

when put to ant runtime you don't need the nested classpath =
<taskdef resource="com.whatever.wsgen.TheClassYouNeedToCall"/>
or
<taskdef resource="com/whatever/antlib.xml"/>


Regards, Gilbert




  

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