Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.1
-
Fix Version/s: 1.0.2
-
Component/s: modello-core
-
Labels:None
-
Complexity:Intermediate
-
Testcase included:yes
-
Number of attachments :
Description
When calling ModelloCli as it's done in this helper class (http://svn.debian.org/wsvn/pkg-java/trunk/maven-ant-helper/src/main/java/ModelloTask.java?op=file&rev=0&sc=0), or when running Modello stadanlone, the Modello plugins are no longer discovered.
With Modello 1.0, my test code which makes a dump of the plugins available in MetadataPluginManager and GeneratorPluginManager from ModelloCore displays this:
org.codehaus.modello.plugin.model.ModelMetadataPlugin@396fe0f4
org.codehaus.modello.plugin.java.metadata.JavaMetadataPlugin@7a148bd3
—
org.codehaus.modello.plugin.java.JavaModelloGenerator@292d15a9
—
And with Modello 1.0.1, the same dump produces:
org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.codehaus.modello.core.ModelloCore', it could not be started
at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:156)
at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:69)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:241)
at com.mycompany.test.App.main(App.java:23)
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:146)
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:132)
at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:90)
at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:147)
... 4 more
I am attaching my test project which reproduces this error. Thanks!
if you look at the bottom of the stacktrace, you'll see Caused by: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/Scanner
and modello-core 1.0.1 depends on plexus-build-api 0.0.3, which depends on plexus-utils 1.5.8
but plexus-utils 1.4.5 gets picked, since it's a dependency of plexus-container-default which is declared before plexus-build-api
then the workaround for now is to add a direct dependency to plexus-utils 1.5.8 in your project
for Modello 1.0.2, I'll change the order between plexus-build-api and plexus-container-default: plexus-utils 1.5.8 will be picked automatically instead of 1.4.5
done in r1229