views:

537

answers:

3

I would like to add an additional class path to the exec-maven-plugin.
Besides the %classpath, I would like to add an extra path to a directory containing resources (/Users/kornp/resources). Currently, my pom looks like this:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.1.1</version>
  <configuration>
    <executable>java</executable>
    <classpathScope>runtime</classpathScope>
    <arguments>
      <argument>%classpath:/Users/kornp/resources</argument>
      <argument>org.drrabbit.maventest.App</argument>
    </arguments>
  </configuration>
</plugin>

How should I configure this?

A: 

The resources generally should be on the classpath as well. Why do you need them in a separate location?

Bozhidar Batsov
That's because the way the project is set up. That module is part of an application where the resources are kept in a central place.
KornP
Well, in my case because the person who worked on the project before me placed a configurations file outside the jar onto the classpath. Besides: asking why is not an answer and should be placed into a comment.
Martin
A: 

Did you try using the commandlineArgs parameter (as mentioned in the exec example)?

Pascal Thivent
Yes, I did, but then the %classpath doesn't work anymore.
KornP
@Kornp Arf, sorry then, that was not my understanding of the example. I don't know if there is another way though. Is setting the classpath manually an option?
Pascal Thivent
Yes, it's an option, but there are quite a lot of jar files involved. So, it will be a tedious job.Thanks for the suggestion though.
KornP
A: 

Okay,

I adapted the plugin so that the command line arguments can be fully specified (including the %classpath parameter)

KornP
If you care to copy the result into the answer you might eventualy get the 3 up votes for the self learner badge.
Martin
Martin, what do you mean with copy the result into the answer?
KornP