inheriting generating classpath inside plugins

2006-02-16 Thread Jake Pezaro
i have written a new plugin.  however, no matter what dependencies are
defined by the calling pom, my pluging has only 2 jars on it's
classpath.  they are:

when running maven from the command line:
.../maven-2.0.2/core/boot/classworlds-1.1.jar

when running maven from eclipse:
.../eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/maven-e
mbedder-2.0.2-dep.jar
.../eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/m2plugin.ja
r

i need to do know how to do the following two things, but i cannot find
any guidelines on how to do them.

1.  inherit the classpath/dependencies from the calling pom, without
having to explicity re-state them in under
build.plugins.plugin.depedencies
2.  add some additional dependencies to the classpath within the plugin.
these dependencies are all jars located in a directory.

thanks

jake



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

Re: inheriting generating classpath inside plugins

2006-02-16 Thread andrew
Hi Jake,

Have a look at the following:

How Maven's classloaders work
http://maven.apache.org/guides/mini/guide-maven-classloading.html

... each plugin has its own classloader, including its dependencies,
itself, and the libraries above. It *does not* contain the project
dependencies as in Maven 1.x, but instead has access to a list of JAR
files in case they are needed.

The plugin's classpath only contains the plugin's dependencies, not the
calling project's.

In your plugin you need to obtain the project's dependency set and,
using this, create a new classloader.

There is a thread entitled Project dependencies and plugin
classloaders around 14/12/05 in the user list archives that gives an
example of the above.

Cheers,
...andrew

Jake Pezaro wrote:
 i have written a new plugin.  however, no matter what dependencies are
 defined by the calling pom, my pluging has only 2 jars on it's
 classpath.  they are:
 
 when running maven from the command line:
 .../maven-2.0.2/core/boot/classworlds-1.1.jar
 
 when running maven from eclipse:
 .../eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/maven-e
 mbedder-2.0.2-dep.jar
 .../eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/m2plugin.ja
 r
 
 i need to do know how to do the following two things, but i cannot find
 any guidelines on how to do them.
 
 1.  inherit the classpath/dependencies from the calling pom, without
 having to explicity re-state them in under
 build.plugins.plugin.depedencies
 2.  add some additional dependencies to the classpath within the plugin.
 these dependencies are all jars located in a directory.
 
 thanks
 
 jake
 
 
 
 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email 
 __

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]