-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use ModelloCLI to convert .mdo files into *.java files - Unable to load java plugin #15
Comments
Looks like this is a long time known issue since 2009... |
That issue is unrelated, as it was from a missing jar/cnfe. I believe I am having a Generator issue. It seems to find and list the MetaDataPlugins JavaMetaDataPlugin, but not sure about the Generators, JavaModelloGenerator. If I add the following to modello-core components.xml. Which I know is incorrect, but it is the only change that seems to have any effect. Also what makes me think my problem is something related to Generators, that plugin manager or something. --- a/src/main/resources/META-INF/plexus/components.xml
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -41,5 +41,10 @@
<role-hint>model</role-hint>
<implementation>org.codehaus.modello.plugin.model.ModelMetadataPlugin</implementation>
</component>
+ <component>
+ <role>org.codehaus.modello.plugin.ModelloGenerator</role>
+ <role-hint>model</role-hint>
+ <implementation>org.codehaus.modello.core.DefaultGeneratorPluginManager</implementation>
+ </component>
</components>
</component-set> I get the following output. Without I do not get the lines with DefaultGeneratorPluginManager # modello extension.mdo java src/main/java 4.0.0 false true
DefaultPlexusContainer
AbstractPluginManager.initialize()
plugins = 2
model : org.codehaus.modello.plugin.model.ModelMetadataPlugin@2b4a2ec7
java : org.codehaus.modello.plugin.java.metadata.JavaMetadataPlugin@62e136d3
AbstractPluginManager.initialize()
plugins = 3
AbstractPluginManager.initialize()
plugins = 0
model : org.codehaus.modello.core.DefaultGeneratorPluginManager@2c34f934
ModelloCore
new Modello()
parsed args
generatorId =java
plugins = 3
model : org.codehaus.modello.core.DefaultGeneratorPluginManager@2c34f934
getPlugin = java
Exception in thread "main" org.codehaus.modello.ModelloRuntimeException: No such plugin: java
at org.codehaus.modello.plugin.AbstractPluginManager.getPlugin(AbstractPluginManager.java:73)
at org.codehaus.modello.core.DefaultGeneratorPluginManager.getGeneratorPlugin(DefaultGeneratorPluginManager.java:39)
at org.codehaus.modello.core.DefaultModelloCore.generate(DefaultModelloCore.java:374)
at org.codehaus.modello.Modello.generate(Modello.java:67)
at org.codehaus.modello.ModelloCli.main(ModelloCli.java:51) Then if I pass model as the argument instead of java. modello extension.mdo model src/main/java 1.0.0 false true
DefaultPlexusContainer
AbstractPluginManager.initialize()
plugins = 2
model : org.codehaus.modello.plugin.model.ModelMetadataPlugin@7fe8ea47
java : org.codehaus.modello.plugin.java.metadata.JavaMetadataPlugin@1dd92fe2
AbstractPluginManager.initialize()
plugins = 2
AbstractPluginManager.initialize()
plugins = 0
model : org.codehaus.modello.core.DefaultGeneratorPluginManager@176d53b2
ModelloCore
new Modello()
parsed args
generatorId =model
plugins = 2
model : org.codehaus.modello.core.DefaultGeneratorPluginManager@176d53b2
getPlugin = model
Exception in thread "main" java.lang.ClassCastException: org.codehaus.modello.core.DefaultGeneratorPluginManager cannot be cast to org.codehaus.modello.plugin.ModelloGenerator
at org.codehaus.modello.core.DefaultGeneratorPluginManager.getGeneratorPlugin(DefaultGeneratorPluginManager.java:39)
at org.codehaus.modello.core.DefaultModelloCore.generate(DefaultModelloCore.java:374)
at org.codehaus.modello.Modello.generate(Modello.java:67)
at org.codehaus.modello.ModelloCli.main(ModelloCli.java:51) |
I am doing abnormal things! I have modello built and running fine. I am trying to use the java plugin. I am seeing some really strange stuff. It seems to initialize twice, and only on the first is the plugins populated. Such that when it goes to getPlugin, the hashmap is empty. I added some debug code.
Here is the output,and you can see the plugins are available at first. But then it inits again, not sure why. Seems that is where the empty hashmap comes from. Next I will throw an exception so I can see what is calling that each time. Not sure if this is a bug, or usability issues. Maybe order of plexus jars on classpath? I am doing this via command line, ModelloCLI.
You can see the 2 inits, and by the time it calls getPlugin method, its empty.
The text was updated successfully, but these errors were encountered: