maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenney Westerhof (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MNG-1323) Plugin extensions (dependencies) not resolved in reactor build
Date Fri, 14 Apr 2006 15:54:49 GMT
    [ http://jira.codehaus.org/browse/MNG-1323?page=comments#action_63562 ] 

Kenney Westerhof commented on MNG-1323:
---------------------------------------

Hm.. this problem is really annoying and there is no workaround. Now I even get a weirder
error:

java.lang.NoSuchMethodError: java_cup.runtime.lr_parser.parse()V
        at org.jacorb.idl.JacIDL.execute(JacIDL.java:356)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

The org.jacorb.idl stuff AND the java_cup.runtime are both in the same jar file! This might
be a bug
in Jacorb, but when run from the projects themselves, everything goes OK. 
It doesn't matter if I specify the dependencies in a dependencyManagement in the root pom,
or in the project's declaring the plugin themselves.

I even tried the idlj-maven-plugin in mojo's sandbox. It's used twice in the entire reactor
tree.
The plugin itself does not define the jacorb dependency, so I had to define it. I tried <build><extensions>,
root pom's pluginManagement, and both pom's. Since this is the exact same plugin with the
exact same
deps and configuration, it should work. Unfortunately it doesn't.

Now, about a solution.

M2 currently disposes the PlexusRealm for the plugin after each execution. However,
the classloader is set to the mojoDescriptor.getPluginDescriptor().getClassRealm().getClassLoader().
This classloader/classRealm is NOT disposed of. I'm not sure why the PlexusRealm isn't equal
to the
pluginDescriptor's classRealm. There should be one access point to manage a plugin's execution
environment.

If this were fixed, John Casey's comment above about the ArtifactHandlerManager comes into
play.

A suggestion: We could leave the plugin's declared dependencies in the same classloader as
the plugin's artifact.
We could add a NEW classloader containing the project's <dependencies> for that plugin,
and hook that into
the plugin's classloader as a child. After execution, we unhook it (perhaps a child PlexusRealm?)

I would really like to get this fixed in 2.0.5. My previous workaround (specifying the filename
of the dependency
in an ant script's TaskDef tag) doesn't work anymore since 2.0.4.

> Plugin extensions (dependencies) not resolved in reactor build
> --------------------------------------------------------------
>
>          Key: MNG-1323
>          URL: http://jira.codehaus.org/browse/MNG-1323
>      Project: Maven 2
>         Type: Bug

>   Components: Plugins and Lifecycle
>     Versions: 2.0
>     Reporter: Kenney Westerhof
>      Fix For: 2.0.5

>
>
> I've added a dependency on an Ant Task in project/build/plugins/plugin[artifactId='maven-antrun-plugin']/dependencies/
and run that anttask using the antrun plugin.
> When run from the project dir itself it runs fine.
> When running from the root of the project tree (reactor build, project one level below
root),
> antrun bails out because the taskdef can't be found (not on classpath).
> It looks like the dependency isn't resolved, or not added to the plugins' classrealm.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message