I can build the plugin artifact :Artifact pluginArtifact =
                    embedder.createArtifact( plugin.getGroupId(),
plugin.getArtifactId(), plugin.getVersion(),
                        Artifact.SCOPE_RUNTIME, "maven-plugin" );

then get the declared dependencies :
List dependencies = plugin.getDependencies();

Then build a URLClassLoader to get the resource URL
 URL[] urls = new URL[] { ... };
 ClassLoader classLoader = new URLClassLoader( urls );
 URL url = classLoader.getResource( configLocation.getValue() );

But as you suggested, this code allready exists somewhere in maven !

I also don't know how to get dependencies from pluginArtifact : how to build
a mavenProject from it to get mavenProject.getArtifacts() ?


2008/11/6 Eugene Kuleshov <[EMAIL PROTECTED]>

>
>
> nicolas de loof-3 wrote:
> >
> >>   I suppose you could get resolved dependencies from MavenProject
> >> instance
> >> passed to you from configurator, so you could create your own
> >> URLClassLoader
> >> from those jars.
> >
> > I need to get the PLUGIN dependencies, not the project one. AFAIK the
> > MavenProject API doesn't give me access to plugins
> > ClassRealm/ClassPath/artifacts
> >
>
>   Right. You can still read MavenProject for prugin artifact to get its
> dependencies. Though that won't give you dependencies declared in
> plugin/dependencies element. Maybe Shane, John or Jason can point you to
> the
> Maven classes that already implementing all this logic.
>
>  regards,
>  Eugene
>
>
> --
> View this message in context:
> http://www.nabble.com/m2eclipse-checkstyle-support-tp20357992p20364498.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to