Re: [mevenide-user] How do you add to classpath when using exec:java plugin

"Milos Kleint" <[email protected]> Tue, 29 Jan 2008 10:52:36 +0100
Newsgroups gmane.comp.jakarta.turbine.maven.mevenide.user
Message-ID <[email protected]>
Hello,

I'm not very fluent with the exec-maven-plugin. But I think it doesn't
support your usecase. All dependencies in maven boil down to artifact
jars in local repository. So your dependency will always be a jar I
suppose.
maybe when both projects (the one you want to execute and it's
dependency with the mentioned class) are in the reactor (thus when you
execute their common parent, then they could be referencing each
other's target/classes folders. Not sure if you manage to execute the
main class from project in this setup with the correct classpath.

Regards

Milos

On Jan 28, 2008 6:28 PM, shep <[email protected]> wrote:
>
> I have a multiple module project. Most of the modules package as a jar. I am
> trying to run a class using the exec plugin. Here is the command I use (note
> it is configured using netbens6)
>
> Executing:C:\Apps\apache-maven-2.0.8\bin\mvn.bat -Dexec.args=full -classpath
> -Dexec.mainClass=com.ngc.casper.persistent.PersistentCollection --debug
> --errors exec:java
>
> The problem I am having is that one of the files that is used by the class
> is found in one of the jar files (dependencies). Which is good that the
> -classpath caused the dependency to be found, but I want to find this file
> in the dependent module's target/classes directory. When the App is
> deployed, this file is read as a file, not as a stream. i.e. if I pull the
> file out of a jar I have to use getResourceAsStream. However, I use
> getResource because I get this file off the file system.
>
> So, bottom line, is how can I add/or set the class path on the command line
> when running maven-exec-plugin.
>
> Please, any help would be greatly appreciated.
>
>
> ps. If there is a better way of doing this, that would help also. I have
> Netbeans6 with multiple maven module project. I need to execute/debug
> several of the classes in the various modules. I have tried profiles but
> can't even get the profile to be run. I know I am doing something wrong. But
> can't make any headway.
>
> --
> View this message in context: http://www.nabble.com/How-do-you-add-to-classpath-when-using-exec%3Ajava-plugin-tp15140177p15140177.html
> Sent from the mevenide - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email