Why does exec:java work and exec:exec fail?

Posted by whiskerz on Stack Overflow See other posts from Stack Overflow or by whiskerz
Published on 2010-03-12T15:04:31Z Indexed on 2010/03/12 15:07 UTC
Read the original article Hit count: 178

Filed under:
|

Hey there,

just set up a simple project to test the functionality of the maven exec plugin. I have one class containing one "Hello World" main method. I've tested two configurations of the exec plugin.

        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
          <executable>java</executable>
          <arguments>
            <argument>-classpath</argument>
            <classpath/>
            <argument>test.exec.HelloWorldExec</argument>
          </arguments>
        </configuration>

failed miserably, giving me a ClassNotFoundException, while

        <goals><goal>java</goal></goals>
        <configuration>
          <mainClass>test.exec.HelloWorldExec</mainClass>
        </configuration>            

worked. However I would like to be able to start my java main class in a separate process, so I'd like to understand whats different with exec:exec and how I can get it to work?

Any help appreciated

cheers

Whizz

© Stack Overflow or respective owner

Related posts about java

Related posts about maven