You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tim Patton <tp...@dealcatcher.com> on 2006/08/10 17:25:56 UTC

Simple Problem with exec plugin

I'm trying to get the exec plugin to work, since maven seems like it would make a great application launcher and save me time editing my 1000 char classpath.

I have this in my pom.xml for a project consisting of several modules:

<build>
..
<plugin>
        <groupId>org.codehaus.mojo</groupId>
      <artifactId>exec-maven-plugin</artifactId>
      <version>1.0.1</version>
      <configuration>
          <mainClass>dealcatcher.kolinka.profiler.SingleForumProfile</mainClass>
      </configuration>
      </plugin>
..
</build>

When I run it with "mvn exec:java" I get "Could not load main class.  Terminating.".  I try running mvn package or mvn install beforehand but I'm not sure what I am missing to make this work.

Tim


Re: Simple Problem with exec plugin

Posted by Nick Veys <ps...@gmail.com>.
How are your dependencies defined?  Looking at the java exec mojo:

/**
 * Executes the supplied java class in the current VM with the
enclosing project's
 * dependencies as classpath.
 *
 * @goal java
 * @requiresDependencyResolution runtime
 * @execute phase="validate"
 * @author <a href="mailto:kaare.nilsen@gmail.com">Kaare Nilsen</a>
 *
 */

They should be there if they are at least runtime scope dependencies.
Unless you're trying to run something in the current project, in which
case I would imagine it would need to be built beforehand, in the same
execution of maven.

On 8/10/06, Tim Patton <tp...@dealcatcher.com> wrote:
> I'm trying to get the exec plugin to work, since maven seems like it would make a great application launcher and save me time editing my 1000 char classpath.
>
> I have this in my pom.xml for a project consisting of several modules:
>
> <build>
> ..
> <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>       <artifactId>exec-maven-plugin</artifactId>
>       <version>1.0.1</version>
>       <configuration>
>           <mainClass>dealcatcher.kolinka.profiler.SingleForumProfile</mainClass>
>       </configuration>
>       </plugin>
> ..
> </build>
>
> When I run it with "mvn exec:java" I get "Could not load main class.  Terminating.".  I try running mvn package or mvn install beforehand but I'm not sure what I am missing to make this work.
>
> Tim
>
>
>

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