mraible wrote:
When authoring a plugin, is there an easy way to add the project's
classpath
to the plugin's classpath? I need access to the project's dependencies in
order to resolve some classes.
To my knowledge, there is only the hard way:
Add "@requiresDependencyResolution <scope>" to your mojo to make sure Maven
resolves the dependencies you intend to access.
Acquire the desired class path, either programmatically via
MavenProject.get(Compile|Runtime|Test)ClasspathElements() or declaratively
via some mojo parameter with default-value="${project.*ClasspathElements}".
Create an (isolated) URLClassLoader from the class path and finally start
loading the project classes.
There was some proposal about simplifying this common task over at [EMAIL PROTECTED]
[0] but I'm not sure how far this has progressed.
Benjamin
[0]
http://www.nabble.com/-proposal--AbstractMojo-enhancement-td16516834.html
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email