Re: Process maven mdo files via ModelloCLI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Process maven mdo files via ModelloCLI

William L. Thomson Jr.
Hi Robert,

On Sun, 24 Jun 2018 11:42:25 +0200
"Robert Scholte" <[hidden email]> wrote:

> Hi William,
>
> I fully agree with you that Maven developers should know about Plexus
> and Modello, and in fact if you compare the names of the developers
> of both projects, you should recognize an overlap.

It is just strange given Maven's popularity and years of use that
underlying things are not more known. I may have to start hunting down
some of those developers directly...

The other option is to move away from the mdo files, Which would drop
the dependency on Modello at least. That is my biggest issue,
processing the mdo files into java files for compile. Plexus can
remain, as its a runtime depdenency. Modello I believe is just a build
one. Or move to something else, antlr, javacc, jaxb, xlc, etc Tons of
things to generate Java files.

Seems like nothing other than Maven uses Modello. And few are familiar
with that. I have less issues with Plexus. Though I believe my issues
with Modello come from it being built on top of Plexus. It uses Plexus
for loading plugins, etc.

> For me this case is too specific, it would take quite some time to
> dive into, while many, many other issues are waiting as well to be
> fixed. And in fact, your issue starts with this sentence "I am doing
> abnormal things!" :)

Abnormal, meaning I am building maven from source. Which most
do not do. Those who do, likely use Maven to build Maven... Which I
cannot do, thus the dilemma.

People have tried and failed at integrating Maven with Gentoo's
Portage. They are conflicting technologies same with Gradle. At least
Ant + Ivy, the ivy parts could be bypassed and if any did any
downloading stop that. That is not really an option with Maven or
Gradle. Not to mention the whole bootstrapping issue to build using
provided build systems.

That said, Modello has a CLI. Using ModelloCLI to process mdo files
should not really require voodoo or be considered anything that
abnormal. It just seems like no one uses the mdo format outside of
Maven. Anyone who does likely uses the Modello Maven Plugin.
https://github.com/codehaus-plexus/modello/blob/master/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
https://github.com/codehaus-plexus/modello/tree/master/modello-maven-plugin

I was happy to see ModelloCLI, sad it does not work. I made a similar
CLI for jaxb. Which I use to process files for Jersey.
https://github.com/javaee/jaxb-istack-commons/pull/2

> Based on the analysis in the comments the issue does seem to be
> having 2 instances instead of 1. I would try to figure out where and
> why this is happening.

That I have been doing for sometime. Its rare for me to reach out for
help in building stuff. I have all sorts of Java code generators to
generate Java code from some other format. Nothing has ever stumped me
like this. I have put in all sorts of debugging code. Tons of various
trial and error. None have shown any signs of progress even.

> If you find the bug and are able to fix it, please provide a PR so we
> can improve Modello.

I cannot tell if its a bug, or a design change. It seems like the CLI
does not fully load all plugins. Not sure if that is a code issue,
something in the plexus component.xml files, not having a plexus.xml,
or some other issue like the versions in use.

--
William L. Thomson Jr.

attachment0 (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Process maven mdo files via ModelloCLI

Robert Scholte-8
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

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.

I hope this helps you a bit further.

Robert

On Mon, 25 Jun 2018 16:28:20 +0200, William L. Thomson Jr.  
<[hidden email]> wrote:

> Hi Robert,
>
> On Sun, 24 Jun 2018 11:42:25 +0200
> "Robert Scholte" <[hidden email]> wrote:
>
>> Hi William,
>>
>> I fully agree with you that Maven developers should know about Plexus
>> and Modello, and in fact if you compare the names of the developers
>> of both projects, you should recognize an overlap.
>
> It is just strange given Maven's popularity and years of use that
> underlying things are not more known. I may have to start hunting down
> some of those developers directly...
>
> The other option is to move away from the mdo files, Which would drop
> the dependency on Modello at least. That is my biggest issue,
> processing the mdo files into java files for compile. Plexus can
> remain, as its a runtime depdenency. Modello I believe is just a build
> one. Or move to something else, antlr, javacc, jaxb, xlc, etc Tons of
> things to generate Java files.
>
> Seems like nothing other than Maven uses Modello. And few are familiar
> with that. I have less issues with Plexus. Though I believe my issues
> with Modello come from it being built on top of Plexus. It uses Plexus
> for loading plugins, etc.
>
>> For me this case is too specific, it would take quite some time to
>> dive into, while many, many other issues are waiting as well to be
>> fixed. And in fact, your issue starts with this sentence "I am doing
>> abnormal things!" :)
>
> Abnormal, meaning I am building maven from source. Which most
> do not do. Those who do, likely use Maven to build Maven... Which I
> cannot do, thus the dilemma.
>
> People have tried and failed at integrating Maven with Gentoo's
> Portage. They are conflicting technologies same with Gradle. At least
> Ant + Ivy, the ivy parts could be bypassed and if any did any
> downloading stop that. That is not really an option with Maven or
> Gradle. Not to mention the whole bootstrapping issue to build using
> provided build systems.
>
> That said, Modello has a CLI. Using ModelloCLI to process mdo files
> should not really require voodoo or be considered anything that
> abnormal. It just seems like no one uses the mdo format outside of
> Maven. Anyone who does likely uses the Modello Maven Plugin.
> https://github.com/codehaus-plexus/modello/blob/master/modello-core/src/main/java/org/codehaus/modello/ModelloCli.java
> https://github.com/codehaus-plexus/modello/tree/master/modello-maven-plugin
>
> I was happy to see ModelloCLI, sad it does not work. I made a similar
> CLI for jaxb. Which I use to process files for Jersey.
> https://github.com/javaee/jaxb-istack-commons/pull/2
>
>> Based on the analysis in the comments the issue does seem to be
>> having 2 instances instead of 1. I would try to figure out where and
>> why this is happening.
>
> That I have been doing for sometime. Its rare for me to reach out for
> help in building stuff. I have all sorts of Java code generators to
> generate Java code from some other format. Nothing has ever stumped me
> like this. I have put in all sorts of debugging code. Tons of various
> trial and error. None have shown any signs of progress even.
>
>> If you find the bug and are able to fix it, please provide a PR so we
>> can improve Modello.
>
> I cannot tell if its a bug, or a design change. It seems like the CLI
> does not fully load all plugins. Not sure if that is a code issue,
> something in the plexus component.xml files, not having a plexus.xml,
> or some other issue like the versions in use.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Process maven mdo files via ModelloCLI

William L. Thomson Jr.
In reply to this post by William L. Thomson Jr.
On Mon, 25 Jun 2018 10:28:20 -0400
"William L. Thomson Jr." <[hidden email]> wrote:
>
> I cannot tell if its a bug, or a design change. It seems like the CLI
> does not fully load all plugins. Not sure if that is a code issue,
> something in the plexus component.xml files, not having a plexus.xml,
> or some other issue like the versions in use.

Aside from the HashMap issues for Generators. I just ran into this with
maven-core. Makes me think Maven is using an older or different version
of plexus-container-default, and maybe other plexus/modello versions.

From looking at plexus-container-default, seems like this change
happened long ago. I went through many commits from 2009. I can only
find 1 so far from 2008 that has 3 arguments/parameters for
DefaultPlexusContainer.discoverComponents()

org/apache/maven/plugin/internal/DefaultMavenPluginManager.java:435: error: no suitable method found for discoverComponents(ClassRealm,SessionScopeModule,MojoExecutionScopeModule)
            ( (DefaultPlexusContainer) container ).discoverComponents( pluginRealm, new SessionScopeModule( container ),
                                                  ^
    method DefaultPlexusContainer.discoverComponents(ClassRealm) is not applicable
      (actual and formal argument lists differ in length)
    method DefaultPlexusContainer.discoverComponents(ClassRealm,Object) is not applicable
      (actual and formal argument lists differ in length)


That has not had 3 arguments/parameters for a long time.
https://github.com/codehaus-plexus/plexus-containers/blob/plexus-containers-1.x/plexus-container-default/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java

History
https://github.com/codehaus-plexus/plexus-containers/commits/plexus-containers-1.x/plexus-container-default/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java

Only time I have seen 3 arguments/parameters for discoverComponents
https://github.com/codehaus-plexus/plexus-containers/commit/615f7567fc570a85a6318647d89f9fe4d2b88e54#diff-8a3e7df59afb3838c1dd2158a072225a


--
William L. Thomson Jr.

attachment0 (201 bytes) Download Attachment