You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kenney Westerhof (JIRA)" <ji...@codehaus.org> on 2006/12/22 15:32:41 UTC

[jira] Commented: (MNG-2225) Classloader problem when adding jars to M2_HOME

    [ http://jira.codehaus.org/browse/MNG-2225?page=comments#action_83247 ] 
            
Kenney Westerhof commented on MNG-2225:
---------------------------------------

It would be better if mojo dependencies took precedence over those in the core realm, especially with all the plexus-utils problems.

Mojo's should be able to use any component version they desire. Only core components api's that are already used by the maven
core should take precedence; in this case only maven-project, maven-plugin-api and possibly maven-artifact; the rest is not needed
and can be replaced by custom versions used by mojo's.

it comes down to limiting items in mojo's parent classloader to ONLY the interfaces/instances that maven core uses and cannot
be replaced. These are: (amongst others):

* MavenProject
* ArtifactFactory
* ArtifactResolution stuff

this list should be as small as possible - no implementations whatsoever should be exported to mojo's.
Here's the current list:
|| Loc   || Artifact || Export to Mojo ||
| core/ |plexus-component-api-1.0-alpha-13.jar | (-) |
| core/ |plexus-container-default-1.0-alpha-14.jar| (-) |
| core/ |plexus-utils-1.1.jar| (-) |
| core/boot | plexus-classworlds-1.2-alpha-5.jar| (-) |
| lib/ |commons-cli-1.0.jar | (-) |
| lib/ |doxia-sink-api-1.0-alpha-9-20061107.221350-3.jar | (-) |
| lib/ |jsch-0.1.27.jar | (-) |
| lib/ |jtidy-4aug2000r7-dev.jar | (-) |
| lib/ |maven-artifact-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-artifact-manager-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-cli-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-core-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-embedder-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-error-diagnostics-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-model-2.1-SNAPSHOT.jar | (+) |
| lib/ |maven-monitor-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-plugin-api-2.1-SNAPSHOT.jar | (+) |
| lib/ |maven-plugin-descriptor-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-plugin-parameter-documenter-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-plugin-registry-2.1-SNAPSHOT.jar | (?) |
| lib/ |maven-profile-2.1-SNAPSHOT.jar | (?) |
| lib/ |maven-project-2.1-SNAPSHOT.jar | (+) |
| lib/ |maven-reporting-api-2.1-SNAPSHOT.jar | (+) |
| lib/ |maven-repository-metadata-2.1-SNAPSHOT.jar | (-) |
| lib/ |maven-settings-2.1-SNAPSHOT.jar | (?) |
| lib/ |maven-tools-2.1-SNAPSHOT.jar | (?) |
| lib/ |plexus-interactivity-api-1.0-alpha-4.jar | (-) |
| lib/ |wagon-file-1.0-beta-2.jar | (-) |
| lib/ |wagon-http-lightweight-1.0-beta-2.jar | (-) |
| lib/ |wagon-http-shared-1.0-beta-2.jar | (-) |
| lib/ |wagon-provider-api-1.0-beta-2.jar | (?) |
| lib/ |wagon-ssh-1.0-beta-2.jar  | (-) |
| lib/ |wagon-ssh-common-1.0-beta-2.jar | (-) |
| lib/ |wagon-ssh-external-1.0-beta-2.jar | (-) |
| lib/ |xml-apis-1.0.b2.jar | (-) |

So basically everything that's maven-version specific - only APIs, modello models and in this case also MavenProject since it 
contains the runtime project representation.

I think this is easily solved by updating the m2.conf and add another classloader.

> Classloader problem when adding jars to M2_HOME
> -----------------------------------------------
>
>                 Key: MNG-2225
>                 URL: http://jira.codehaus.org/browse/MNG-2225
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>            Reporter: Carlos Sanchez
>            Priority: Critical
>             Fix For: 2.1
>
>         Attachments: testwagonscm.tgz
>
>
> Added these jars to M2_HOME/custom to allow using scm based remote repos
> http://www.ibiblio.org/maven2/org/apache/maven/scm/maven-scm-api/1.0-beta-2/maven-scm-api-1.0-beta-2.jar
> http://www.ibiblio.org/maven2/org/apache/maven/scm/maven-scm-manager-plexus/1.0-beta-2/maven-scm-manager-plexus-1.0-beta-2.jar
> http://www.ibiblio.org/maven2/org/apache/maven/scm/maven-scm-provider-svn/1.0-beta-2/maven-scm-provider-svn-1.0-beta-2.jar
> http://cvs.apache.org/maven-snapshot-repository/org/apache/maven/wagon/wagon-scm/1.0-alpha-7-SNAPSHOT/wagon-scm-1.0-alpha-7-20060308.183410-3.jar
> bin/m2.conf
> main is org.apache.maven.cli.MavenCli from plexus.core.maven
> set maven.home default ${user.home}/m2
> [plexus.core]
> load ${maven.home}/core/*.jar
> [plexus.core.maven]
> load ${maven.home}/custom/*.jar
> load ${maven.home}/lib/*.jar
> When running "mvn install" and "mvn testwagonscm:test" in the attached test case you get a ClassCastException although the Class to assign to and the assigned one are the same. The problem seems to be that they come from different classloaders. This problem makes the project-info-report:scm goal fail.

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