> -----Original Message-----
> From: Jesper Linvald [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 12:52 PM
> To: [EMAIL PROTECTED]
> Subject: How to run java ?
> 
> Hello gurus,
> 
> Is there a goal similar to ants java goal (<java classname="xxx... )?
> 
> Can�t seem to find any such goal :(

Surprisingly no.  I really think this should be built-in.
Here's what I do to get around the lack of a predefined goal.

First, I create a maven.xml file with the following contents.

<project default="run"
  xmlns:ant="jelly:ant"
  xmlns:j="jelly:core"
  xmlns:maven="jelly:maven">

  <!-- Runs the Java application specified by the mainClass property. -->
  <goal name="run">
    <attainGoal name="java:compile"/>
    <path id="cp">
      <pathelement location="${maven.build.dest}"/>
      <path refid="maven.dependency.classpath"/>
    </path>
    <java classname="${mainClass}" classpathref="cp" fork="true"/>
  </goal>
  
</project>

Second, I add the following to my project.properties file.

mainClass=com.ociweb.sample.App

 


-------------------------------------------------------------------------------------
A.G. Edwards & Sons' outgoing and incoming e-mails are electronically
archived and subject to review and/or disclosure to someone other 
than the recipient.

-------------------------------------------------------------------------------------

Reply via email to