You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jaikiran <ja...@yahoo.co.in> on 2008/12/08 12:33:48 UTC

How to add a local jar to the classpath of exec-maven-plugin

I am using Maven2 and trying to run a java class from Maven using the
exec-maven-plugin. Here's how it looks like:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1-beta-1</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>java</executable>
          <arguments>
            <argument>-classpath</argument>
	        <classpath/>
            <argument>org.myapp.client.Client</argument>
            
          </arguments>
        </configuration>
      </plugin>

Notice the use of <classpath/>. The org.myapp.client.Client class also has a
dependency on a local jar file xyz.jar (which is not in maven repo). I have
the path to the jar file, but is there any way i can pass this to the
classpath of the exec-maven-plugin? 
-- 
View this message in context: http://www.nabble.com/How-to-add-a-local-jar-to-the-classpath-of-exec-maven-plugin-tp20893674p20893674.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How to add a local jar to the classpath of exec-maven-plugin

Posted by Jaikiran <ja...@yahoo.co.in>.

Stephen Connolly-2 wrote:
> 
> Options:
> 
> 1. Add xyz to your repo (seriously, this is the easiest)
> 
> 2. Add xyz as a dependency to the plugin using the system scope (not too
> difficult, but you'd be better off with 1 as once you start using the
> system
> scope, you'll incorrectly think it's the solution to all your problems and
> then it will bite you in the ass somewhere else)
> 
Thanks for the ideas and the quick reply, Stephen. I'll add the xyz to the
repo - looks like an elegant approach.

Thanks!
-- 
View this message in context: http://www.nabble.com/How-to-add-a-local-jar-to-the-classpath-of-exec-maven-plugin-tp20893674p20894581.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How to add a local jar to the classpath of exec-maven-plugin

Posted by Stephen Connolly <st...@gmail.com>.
Options:

1. Add xyz to your repo (seriously, this is the easiest)

2. Add xyz as a dependency to the plugin using the system scope (not too
difficult, but you'd be better off with 1 as once you start using the system
scope, you'll incorrectly think it's the solution to all your problems and
then it will bite you in the ass somewhere else)

2008/12/8 Jaikiran <ja...@yahoo.co.in>

>
> I am using Maven2 and trying to run a java class from Maven using the
> exec-maven-plugin. Here's how it looks like:
>
> <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>exec-maven-plugin</artifactId>
>        <version>1.1-beta-1</version>
>        <executions>
>          <execution>
>            <goals>
>              <goal>exec</goal>
>            </goals>
>          </execution>
>        </executions>
>        <configuration>
>          <executable>java</executable>
>          <arguments>
>            <argument>-classpath</argument>
>                <classpath/>
>            <argument>org.myapp.client.Client</argument>
>
>          </arguments>
>        </configuration>
>      </plugin>
>
> Notice the use of <classpath/>. The org.myapp.client.Client class also has
> a
> dependency on a local jar file xyz.jar (which is not in maven repo). I have
> the path to the jar file, but is there any way i can pass this to the
> classpath of the exec-maven-plugin?
> --
> View this message in context:
> http://www.nabble.com/How-to-add-a-local-jar-to-the-classpath-of-exec-maven-plugin-tp20893674p20893674.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>