Robert,

        Nice timing, our posts literally crossed at the same time! Also
on the same topic, Generators vs MetaDataPlugins.

On Mon, 25 Jun 2018 22:10:48 +0200
"Robert Scholte" <[email protected]> wrote:

> I've got some answers for you:
> 
> you're seeing 2 times init because there are 2 AbstractPluginManager  
> instances: org.codehaus.modello.core.MetadataPluginManager and  
> org.codehaus.modello.core.GeneratorPluginManager

That part I have figured out. I also played around with components.xml
and in an incorrect way got a false Generator to show.
https://github.com/codehaus-plexus/modello/issues/15#issuecomment-397433691

But that is not correct, as when I go to use I get a class cast
exception.
org.codehaus.modello.core.DefaultGeneratorPluginManager cannot be cast
to org.codehaus.modello.plugin.ModelloGenerator

That at least loaded a Generator that could be found via ModelloCLI.
The furthest I have gotten, and it is not correct. Only sign of any
progress thus far :(

> They are initiated when calling the Modello()-constructor. It creates
> the DefaultPlexusContainer, which is the CDI container used. Based on
> the META-INF/plexus/components.xml it'll instantiate and bind all
> the instances.

For some reasons it seems like the Generators are not being loaded or
bound. Or maybe they are, and something is messing up the HashMap. In
my debug output, I get a count from plugin Generators. HashMap has a
size, but I cannot loop through the elements in any normal means.

Which I believe is also causing the default lookup to fail. If I cannot
loop through and print out Generator plugins in the Generators plugin
HashMap. That would also explain why ModelloCLI cannot lookup the
plugin using the same method, getting value based on key.

Not sure which is null, key or value, or why. Or why hacking the
components.xml loads a bad Generator. When I cannot get it to load
valid ones.

It maybe a bug somewhere.

-- 
William L. Thomson Jr.

Attachment: pgpAs8_kxX0x7.pgp
Description: OpenPGP digital signature

Reply via email to