maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bentmann (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MANTRUN-123) Plugin class path pollutes class path of custom tasks
Date Mon, 16 Nov 2009 11:57:55 GMT

    [ http://jira.codehaus.org/browse/MANTRUN-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=198403#action_198403
] 

Benjamin Bentmann commented on MANTRUN-123:
-------------------------------------------

The problem here is that the Ant Tasks see the wrong classes. The Ant Tasks are fully self-contained
but when run by the AntRun Plugin, many classes get erroneously loaded from the Maven core
realm instead of the {{maven-ant-tasks.jar}}, giving rise to linkage errors like the one reported
here.

A temporary workaround seems to be the {{reverseLoader="true"}} attribute for the {{<typedef>}}:
{code:xml}
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
reverseLoader="true">
{code}

Not sure how this can be fixed ultimately, i.e. whether the AntRun Plugin can be enhanced
to provide better class loader isolation or whether we need to workaround this in the Ant
Tasks by shading each and every class.

> Plugin class path pollutes class path of custom tasks
> -----------------------------------------------------
>
>                 Key: MANTRUN-123
>                 URL: http://jira.codehaus.org/browse/MANTRUN-123
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Matt Raible
>         Attachments: err.log
>
>
> Steps to reproduce:
> svn co https://appfuse.dev.java.net/svn/appfuse/trunk/archetypes (user: guest, pass:
<blank>)
> mvn install
> Here's the build.xml file:
> http://source.appfuse.org/browse/appfuse/trunk/archetypes/build.xml?r=HEAD
> [ERROR] An Ant BuildException has occured: The following error occurred while executing
this line:
> /Users/mraible/Work/appfuse/archetypes/build.xml:14: java.lang.NoSuchMethodError: org.codehaus.plexus.DefaultPlexusContainer.setClassWorld(Lorg/codehaus/classworlds/ClassWorld;)V
> -> [Help 1]
> [ERROR] 
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions, please read the
following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

-- 
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