You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Pooja Murjani <Po...@india.Infogain.com> on 2004/12/09 06:38:53 UTC

Executing a java class file

friends....can any one suggest me, how to excute a java class file, thru
maven.
I have done this task by writing 

<java classname="a.b.c"
fork="true"
failonerror="true" >
<arg value="abc"/>
<classpath refid="my.classpath"/>
</java>


can anyone please suggest how to do the equivalent task in Maven.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Executing a java class file

Posted by dan tran <da...@gmail.com>.
In addition, ensure to have this in your goal

    <ant:classpath>
      <ant:pathelement path="${maven.build.dest}"/>
      <ant:path refid="maven.dependency.classpath"/>
    </ant:classpath>


so that java  ant task can find you project classes and its dependencies


On Thu, 09 Dec 2004 09:17:20 -0500, Eric Black <eb...@concord.org> wrote:
> Hi,
> 
> You can put that in a maven.xml file with some goal name and it will
> execute:
> 
> <project xmlns:j="jelly:core" xmlns:ant="jelly:ant">
> <goal name="runabc">
> <ant:java classname="a.b.c"
> fork="true"
> failonerror="true" >
> <ant:arg value="abc"/>
> <ant:classpath refid="my.classpath"/>
> </ant:java>
> </goal>
> </project>
> 
> then in your project directory, run 'maven runabc'.
> 
> It might not work the way I did it, but you can get the idea.
> 
> Eric
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Executing a java class file

Posted by Eric Black <eb...@concord.org>.
Hi,

You can put that in a maven.xml file with some goal name and it will
execute:


<project xmlns:j="jelly:core" xmlns:ant="jelly:ant">
<goal name="runabc">
 <ant:java classname="a.b.c"
fork="true"
failonerror="true" >
<ant:arg value="abc"/>
<ant:classpath refid="my.classpath"/>
</ant:java>
</goal>
</project>

then in your project directory, run 'maven runabc'.

It might not work the way I did it, but you can get the idea.

Eric