ClassNotFound error
-------------------
Key: MNG-3493
URL: http://jira.codehaus.org/browse/MNG-3493
Project: Maven 2
Issue Type: Bug
Affects Versions: 2.0.8
Reporter: Ittay Dror
Actually, not sure if this is a bug, or caused by me trying to bend maven...
Anyway, here goes:
Short summary: A class in plexus-utils is not found
Long story:
I'm trying to use cbuild platform-detector plugin under maven 2.0.8. so i
downloaded the source, installed locally and then tried to use the
inject-properties goal.
Now in my project, I run
mvn -e org.codehaus.mojo:platform-detector-maven-plugin:inject-properties
I get the errors below.
What is interesting, is that I have many versions of plexus-utils:
> ls /work/maven/repository/org/codehaus/plexus/plexus-utils/*/*.jar
/work/maven/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
/work/maven/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
/work/maven/repository/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar
only 1.4.1 contains the Shell class. this is the version used by the plugin.
maybe maven is not using class loaders?
i'm using plexus-container 1.0-alpha-16
here is the error:
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Archive
[INFO] task-segment:
[org.codehaus.mojo:platform-detector-maven-plugin:inject-properties]
[INFO] ------------------------------------------------------------------------
Downloading:
http://java.freehep.org/maven2/org/codehaus/plexus/plexus-utils/1.3/plexus-utils-1.3.pom
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.3/plexus-utils-1.3.pom
1K downloaded
Downloading:
http://java.freehep.org/maven2/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom
2K downloaded
Downloading:
http://java.freehep.org/maven2/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
2K downloaded
Downloading:
http://java.freehep.org/maven2/org/codehaus/plexus/plexus-utils/1.4/plexus-utils-1.4.pom
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4/plexus-utils-1.4.pom
1K downloaded
Downloading:
http://java.freehep.org/maven2/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom
1K downloaded
-----------------------------------------------------
this realm =
app0.child-container[org.codehaus.mojo:platform-detector-maven-plugin]
urls[0] =
file:/work/maven/repository/org/codehaus/mojo/platform-detector-maven-plugin/1.0-alpha-4-SNAPSHOT/platform-detector-maven-plugin-1.0-alpha-4-SNAPSHOT.jar
urls[1] =
file:/work/maven/repository/org/codehaus/mojo/cbuild-utils/1.0-alpha-4-SNAPSHOT/cbuild-utils-1.0-alpha-4-SNAPSHOT.jar
urls[2] =
file:/work/maven/repository/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar
urls[3] =
file:/work/maven/repository/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar
urls[4] =
file:/work/maven/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[5] =
file:/work/maven/repository/org/apache/maven/maven-build-context/2.1-SNAPSHOT/maven-build-context-2.1-SNAPSHOT.jar
urls[6] =
file:/work/maven/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-8/plexus-archiver-1.0-alpha-8.jar
urls[7] =
file:/work/maven/repository/org/apache/maven/shared/file-management/1.0/file-management-1.0.jar
urls[8] =
file:/work/maven/repository/easymock/easymock/1.2_Java1.3/easymock-1.2_Java1.3.jar
Number of imports: 6
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
this realm = plexus.core
urls[0] = file:/opt/maven/lib/maven-2.0.8-uber.jar
Number of imports: 6
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
import: [EMAIL PROTECTED]
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'org.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties':
Unable to find the mojo
'org.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties'
in the plugin 'org.codehaus.mojo:platform-detector-maven-plugin'
org/codehaus/plexus/util/cli/shell/Shell
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the
plugin manager executing goal
'org.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties':
Unable to find the mojo
'org.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties'
in the plugin 'org.codehaus.mojo:platform-detector-maven-plugin'
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:543)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginManagerException: Unable to find the
mojo
'org.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties'
in the plugin 'org.codehaus.mojo:platform-detector-maven-plugin'
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:575)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:425)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Unable to lookup component
'org.apache.maven.plugin.Mojoorg.codehaus.mojo:platform-detector-maven-plugin:1.0-alpha-4-SNAPSHOT:inject-properties',
it could not be started
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:566)
... 18 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLifecycleException:
Error starting component
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
at
org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
... 20 more
Caused by:
org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException:
Error composing component
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
... 23 more
Caused by: org.codehaus.plexus.component.composition.CompositionException:
Composition failed of field functionResolver in object of type
org.codehaus.mojo.platform.properties.PropertyInjectorMojo because the
requirement
ComponentRequirement{role='org.codehaus.mojo.tools.function.FunctionResolver',
roleHint='default', fieldName='functionResolver'} was missing
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
at
org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
at
org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
... 25 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Unable to lookup component
'org.codehaus.mojo.tools.function.FunctionResolverdefault', it could not be
started
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
... 29 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLifecycleException:
Error starting component
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
... 30 more
Caused by:
org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException:
Error composing component
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
... 33 more
Caused by: org.codehaus.plexus.component.composition.CompositionException:
Composition failed of field functionHandlers in object of type
org.codehaus.mojo.tools.function.FunctionResolver because the requirement
ComponentRequirement{role='org.codehaus.mojo.tools.function.FunctionHandler',
roleHint='null', fieldName='functionHandlers'} was missing
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
at
org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
at
org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
at
org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
... 35 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Unable to lookup component
'org.codehaus.mojo.tools.function.FunctionHandlerenvar', it could not be created
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
at
org.codehaus.plexus.DefaultPlexusContainer.lookupMap(DefaultPlexusContainer.java:390)
at
org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:103)
... 39 more
Caused by:
org.codehaus.plexus.component.factory.ComponentInstantiationException: Could
not instanciate component: role:
'org.codehaus.mojo.tools.function.FunctionHandler', implementation:
'org.codehaus.mojo.tools.function.EnvarFunctionHandler', role hint: 'envar'
at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
at
org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
... 42 more
Caused by: java.lang.NoClassDefFoundError:
org/codehaus/plexus/util/cli/shell/Shell
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
... 46 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Apr 01 13:09:25 IDT 2008
[INFO] Final Memory: 7M/68M
[INFO] ------------------------------------------------------------------------
--
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