You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "William L. Thomson Jr." <wl...@o-sinc.com> on 2018/06/14 14:41:14 UTC

Process maven mdo files via ModelloCLI

I have been working on packaging and building Maven from source on
Gentoo. Without using Maven, just straight javac, etc.  It is looking
like I cannot do this without using pre-generated sources on Maven
Central. I am having issues with ModelloCLI loading plugins.
https://github.com/codehaus-plexus/modello/issues/15

My gut says MetadataPlugins are not the same as Generators. Maybe need
to package more of Modello plugins and/or have them on the classpath. I
am really not clear how Modello loads its plugins via Plexus. Once I
can get the plugin loaded. I should be able to proceed. This is where I
am stuck, Modello loading a plugin to generate Java from mdo files.
I do not need any other formats, just Java.

Even more interesting, seems to be a chicken/egg situation with parts
of Plexus. Which also has mdo files.
https://github.com/codehaus-plexus/plexus-containers/tree/plexus-containers-1.x/plexus-container-default/src/main/mdo

Mailing lists for Modello and Plexus seem MIA. It does not seem like
anything else uses this other than Maven. This is not a normal user
issue, thus asking on Maven development list.

If someone here does not know about Modello and Plexus. Not sure where
I can find someone who does... Thanks for any help!

-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Per my final comment question below, the 6 vs 4. That was because
modello-plugin-xpp3 was also on the classpath. Which has 3 Generators
and no MetaDataPlugin, thus it does not show.

Seems more and more like there is a problem with the Generators
HashMap. It has a size, but elements are messed up or something.

I kept thinking maybe I needed to chain in other plugins. But seems
like only the Java one is needed to go from *.mdo to *.java per
description on pom.xml, but maybe misleading.
https://github.com/codehaus-plexus/modello/blob/master/modello-plugins/modello-plugin-java/pom.xml#L13

If it is not a missing plugin needed for Java plugin. Then it must be
something messing up the HashMap for Generators.

On Mon, 25 Jun 2018 16:19:55 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

snip

> Here is some example output with java, xml, and xsd plugins. I see the
> MetaDataPlugins, but never any Generators. The plugin ModelloCLI wants
> is a generator not a MetaDataPlugin.
> 
> --------------------------------------------------------------------------------------------------------------
> 
> $ modello  settings.mdo modello ../java/ 4.0.0 false true
> DefaultPlexusContainer
> AbstractPluginManager.initialize()
> plugins = 4
> xsd :
> org.codehaus.modello.plugin.xsd.metadata.XsdMetadataPlugin@275710fc
> model :
> org.codehaus.modello.plugin.model.ModelMetadataPlugin@4de5031f java :
> org.codehaus.modello.plugin.java.metadata.JavaMetadataPlugin@5d47c63f
> xml :
> org.codehaus.modello.plugins.xml.metadata.XmlMetadataPlugin@3bbc39f8
> AbstractPluginManager.initialize() plugins = 6 ModelloCore new
> Modello() parsed args
> generatorId = modello
> plugins = 6
> getPlugin = modello
> Exception in thread "main"
> org.codehaus.modello.ModelloRuntimeException: No such plugin: modello
> 
> --------------------------------------------------------------------------------------------------------------
> 
> Not sure how it sees 6 plugins from 4 before. Or why I cannot access
> any. Seems like some Generator plugins exist. But the HashMap has
> some issues. Not sure if its improper types being passed or what.
> 



-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Mon, 25 Jun 2018 10:28:20 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> Hi Robert,
> 
> > 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. 

Having spent some time debugging this, I came to realize the it is not
initializing twice. It initializes the MetaDataPlugin as part of Plexus
startup. Which precedes Modello startup. But those are not Generators.
For what ever reason no Generator plugins are loaded, or show up.
But the HashMap has elements.

I can provide the patch, but it basically just does System.out.println
in places where I added text.

In initialize I loop through plugins.

System.out.println("plugins = "+plugins.size());
plugins.forEach((k, v) -> System.out.println(k + " : " + v));

https://github.com/codehaus-plexus/modello/blob/master/modello-core/src/main/java/org/codehaus/modello/plugin/AbstractPluginManager.java#L44

Where plugins is
private Map<String, T> plugins = new HashMap<String, T>()

What is interesting there, is that there is a plugin count, with empty
key or value for Generators . I can try to print out null elements.
Though likely get a NPE or something in that process.

Here is some example output with java, xml, and xsd plugins. I see the
MetaDataPlugins, but never any Generators. The plugin ModelloCLI wants
is a generator not a MetaDataPlugin.

--------------------------------------------------------------------------------------------------------------

$ modello  settings.mdo modello ../java/ 4.0.0 false true
DefaultPlexusContainer
AbstractPluginManager.initialize()
plugins = 4
xsd : org.codehaus.modello.plugin.xsd.metadata.XsdMetadataPlugin@275710fc
model : org.codehaus.modello.plugin.model.ModelMetadataPlugin@4de5031f
java : org.codehaus.modello.plugin.java.metadata.JavaMetadataPlugin@5d47c63f
xml : org.codehaus.modello.plugins.xml.metadata.XmlMetadataPlugin@3bbc39f8
AbstractPluginManager.initialize()
plugins = 6
ModelloCore
new Modello()
parsed args
generatorId = modello
plugins = 6
getPlugin = modello
Exception in thread "main"
org.codehaus.modello.ModelloRuntimeException: No such plugin: modello

--------------------------------------------------------------------------------------------------------------

Not sure how it sees 6 plugins from 4 before. Or why I cannot access any.
Seems like some Generator plugins exist. But the HashMap has some issues.
Not sure if its improper types being passed or what.

-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Mon, 25 Jun 2018 10:28:20 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> 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.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
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" <rf...@apache.org> 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.

Re: Process maven mdo files via ModelloCLI

Posted by Robert Scholte <rf...@apache.org>.
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.  
<wl...@o-sinc.com> wrote:

> Hi Robert,
>
> On Sun, 24 Jun 2018 11:42:25 +0200
> "Robert Scholte" <rf...@apache.org> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Hi Robert,

On Sun, 24 Jun 2018 11:42:25 +0200
"Robert Scholte" <rf...@apache.org> 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.

Re: Process maven mdo files via ModelloCLI

Posted by Robert Scholte <rf...@apache.org>.
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.
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!" :)

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.

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

thanks,
Robert

On Sun, 24 Jun 2018 02:35:28 +0200, William L. Thomson Jr.  
<wl...@o-sinc.com> wrote:

> I guess no one is familiar with Plexus or Modello. If Maven developers
> are not familiar with what technologies Maven is built atop. Not sure
> who else would have a clue about Plexus or Modello.
>
> I can look to building Maven via other means. But does not reflect to
> well on Maven IMHO. Plexus and Modello are part of how Maven is built.
> Someone should have a clue about both.
>
> If your a Maven developer, I highly recommend getting to know Plexus
> and Modello. It is the underlying foundation to Maven it seems.
>
> On Thu, 14 Jun 2018 10:41:14 -0400
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
>> I have been working on packaging and building Maven from source on
>> Gentoo. Without using Maven, just straight javac, etc.  It is looking
>> like I cannot do this without using pre-generated sources on Maven
>> Central. I am having issues with ModelloCLI loading plugins.
>> https://github.com/codehaus-plexus/modello/issues/15
>>
>> My gut says MetadataPlugins are not the same as Generators. Maybe need
>> to package more of Modello plugins and/or have them on the classpath.
>> I am really not clear how Modello loads its plugins via Plexus. Once I
>> can get the plugin loaded. I should be able to proceed. This is where
>> I am stuck, Modello loading a plugin to generate Java from mdo files.
>> I do not need any other formats, just Java.
>>
>> Even more interesting, seems to be a chicken/egg situation with parts
>> of Plexus. Which also has mdo files.
>> https://github.com/codehaus-plexus/plexus-containers/tree/plexus-containers-1.x/plexus-container-default/src/main/mdo
>>
>> Mailing lists for Modello and Plexus seem MIA. It does not seem like
>> anything else uses this other than Maven. This is not a normal user
>> issue, thus asking on Maven development list.
>>
>> If someone here does not know about Modello and Plexus. Not sure where
>> I can find someone who does... Thanks for any help!
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
I guess no one is familiar with Plexus or Modello. If Maven developers
are not familiar with what technologies Maven is built atop. Not sure
who else would have a clue about Plexus or Modello.

I can look to building Maven via other means. But does not reflect to
well on Maven IMHO. Plexus and Modello are part of how Maven is built.
Someone should have a clue about both.

If your a Maven developer, I highly recommend getting to know Plexus
and Modello. It is the underlying foundation to Maven it seems.

On Thu, 14 Jun 2018 10:41:14 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> I have been working on packaging and building Maven from source on
> Gentoo. Without using Maven, just straight javac, etc.  It is looking
> like I cannot do this without using pre-generated sources on Maven
> Central. I am having issues with ModelloCLI loading plugins.
> https://github.com/codehaus-plexus/modello/issues/15
> 
> My gut says MetadataPlugins are not the same as Generators. Maybe need
> to package more of Modello plugins and/or have them on the classpath.
> I am really not clear how Modello loads its plugins via Plexus. Once I
> can get the plugin loaded. I should be able to proceed. This is where
> I am stuck, Modello loading a plugin to generate Java from mdo files.
> I do not need any other formats, just Java.
> 
> Even more interesting, seems to be a chicken/egg situation with parts
> of Plexus. Which also has mdo files.
> https://github.com/codehaus-plexus/plexus-containers/tree/plexus-containers-1.x/plexus-container-default/src/main/mdo
> 
> Mailing lists for Modello and Plexus seem MIA. It does not seem like
> anything else uses this other than Maven. This is not a normal user
> issue, thus asking on Maven development list.
> 
> If someone here does not know about Modello and Plexus. Not sure where
> I can find someone who does... Thanks for any help!
> 



-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Regarding the following message below. What ever is causing the

java.util.NoSuchElementException

Is not only effecting Modello. It is my present blocker to Maven
itself. mvn command errors with similar output

[ERROR] Error executing Maven.
[ERROR] java.util.NoSuchElementException
      role: org.apache.maven.eventspy.internal.EventSpyDispatcher
  roleHint:
[ERROR] Caused by: null
https://github.com/Obsidian-StudiosInc/os-xtoo/issues/54

Fixing it for either, should for the other. Slowly making progress!

On Sun, 26 Aug 2018 15:32:54 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> On Sun, 26 Aug 2018 13:54:13 -0400
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> 
> > Not sure if using plexus-containers rather than sisu-plexus, is the 
> > cause for ModelloCli to not be able to load/find the Java plugin.
> > Just one thing I have not tried with Modello.  
> 
> After trying this out, that does seem to be the problem. I need to
> replace all instances of plexus-container-default with sisu-plexus.
> See the output in this comment, its very different than anything I
> have seen. This is very encouraging!
> 
> [main] WARN Sisu - Error injecting:
> org.codehaus.modello.plugin.java.JavaModelloGenerator
> 
> https://github.com/Obsidian-StudiosInc/os-xtoo/issues/48#issuecomment-416063706
> 
> -- 
> William L. Thomson Jr.




-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Aug 2018 13:54:13 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> Not sure if using plexus-containers rather than sisu-plexus, is the 
> cause for ModelloCli to not be able to load/find the Java plugin. Just
> one thing I have not tried with Modello.

After trying this out, that does seem to be the problem. I need to
replace all instances of plexus-container-default with sisu-plexus.
See the output in this comment, its very different than anything I have
seen. This is very encouraging!

[main] WARN Sisu - Error injecting:
org.codehaus.modello.plugin.java.JavaModelloGenerator

https://github.com/Obsidian-StudiosInc/os-xtoo/issues/48#issuecomment-416063706

-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Hi Hervé,

	Thanks for the response!

On Sun, 26 Aug 2018 19:35:02 +0200
Hervé BOUTEMY <he...@free.fr> wrote:

> Hi William,
> 
> Debian already worked on this: I don't precisely know how they did,
> but you should probably have a look.

Well they can cut some corners as they need to build it just once for
their package. I have to make it such that anyone can build it from
source. Given Gentoo is a from source distro. That is what makes things
a bit harder to package on Gentoo vs binary distros.

> A few hints on your investigations:
> - on the .mdo files in plexus-containers, I added them only to
> generate documentation [1], then you can just ignore that ones

Good to know. That is one of the differences with sisu-plexus. It does
not have that mdo file, and some other changes. But is basically the
same as plexus-containers. Why I think any other stuff using
plexus-containers may work as well with sisu-plexus.

Not sure if using plexus-containers rather than sisu-plexus, is the 
cause for ModelloCli to not be able to load/find the Java plugin. Just
one thing I have not tried with Modello. I have tried a bunch of other
stuff. Packaging the other plugins, various hackish debug code to see
whats being loaded and not. No clue how Modello loads its plugins.
Seems ModelloCli is not really functional or something.

> - are you using the old Ant build file, that was used to bootstrap
> Maven?

No I am using straight javac. Gentoo ebuilds are basically bash
scripts. We have eclasses which are a libary of bash functions for
common re-use.

I have most all of Maven packaged. I just had to use sources from Maven
Central for some packages that had mdo files. Ideally I would like to
use regular sources. Since that also allows live building from git.

Right now one could not use an ebuild to build from git, as I cannot
process the mdo files. Using Maven Central sources works for packaging,
but not for say development. If someone wanted to further maven, or
test out changes in git.


-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by Hervé BOUTEMY <he...@free.fr>.
Hi William,

Debian already worked on this: I don't precisely know how they did, but you 
should probably have a look.

A few hints on your investigations:
- on the .mdo files in plexus-containers, I added them only to generate 
documentation [1], then you can just ignore that ones
- are you using the old Ant build file, that was used to bootstrap Maven?

Regards,

Hervé

[1] http://codehaus-plexus.github.io/plexus-containers/plexus-container-default/plexus-components.html
http://codehaus-plexus.github.io/plexus-containers/plexus-container-default/
plexus-configuration.html

Le jeudi 23 août 2018, 03:21:53 CEST William L. Thomson Jr. a écrit :
> On Thu, 14 Jun 2018 10:41:14 -0400
> 
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> > I have been working on packaging and building Maven from source on
> > Gentoo. Without using Maven, just straight javac, etc.  It is looking
> > like I cannot do this without using pre-generated sources on Maven
> > Central. I am having issues with ModelloCLI loading plugins.
> > https://github.com/codehaus-plexus/modello/issues/15
> > 
> > Even more interesting, seems to be a chicken/egg situation with parts
> > of Plexus. Which also has mdo files.
> > https://github.com/codehaus-plexus/plexus-containers/tree/plexus-container
> > s-1.x/plexus-container-default/src/main/mdo
> Working on actually making my maven packages usable per user
> interest.[1][2] I think I may have a clue as to my longtime issue with
> ModelloCli. The plexus situation is a mess!
> 
> Beyond the Sonatype repos that were forked into codehause-plexus. I
> discovered that Maven itself wants eclipse sisu.plexus[3] NOT
> plexus-container-default[4]. Which are basically the same package.
> Though the sisu.plexus one is a bit different, and is the one Maven
> itself uses. I need to swap some stuff out for Modello and see if that
> fixes my issue with ModelloCli, so I can generate java from .mdo files.
> 
> There is a similar situation with eclipse-aether[5] and
> maven-resolver[6]. But that is more Maven specific, as Modello only
> uses Plexus not Aether.
> 
> Funny enough I started out packaging Maven for Gradle. I am making
> more progress with Maven cli mvn [1] than I am with Gradle's cli :)
> 
> Maven from source on Gentoo has been voodoo for years till 2018!!!
> 
> 1. https://github.com/Obsidian-StudiosInc/os-xtoo/issues/54
> 2. https://github.com/Obsidian-StudiosInc/os-xtoo/issues/56
> 3.
> https://github.com/eclipse/sisu.plexus/tree/master/org.eclipse.sisu.plexus
> 4.
> https://github.com/codehaus-plexus/plexus-containers/tree/master/plexus-con
> tainer-default 5. https://github.com/eclipse/aether-core
> 6. https://github.com/apache/maven-resolver



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Thu, 14 Jun 2018 10:41:14 -0400
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> I have been working on packaging and building Maven from source on
> Gentoo. Without using Maven, just straight javac, etc.  It is looking
> like I cannot do this without using pre-generated sources on Maven
> Central. I am having issues with ModelloCLI loading plugins.
> https://github.com/codehaus-plexus/modello/issues/15

> Even more interesting, seems to be a chicken/egg situation with parts
> of Plexus. Which also has mdo files.
> https://github.com/codehaus-plexus/plexus-containers/tree/plexus-containers-1.x/plexus-container-default/src/main/mdo

Working on actually making my maven packages usable per user
interest.[1][2] I think I may have a clue as to my longtime issue with
ModelloCli. The plexus situation is a mess!

Beyond the Sonatype repos that were forked into codehause-plexus. I
discovered that Maven itself wants eclipse sisu.plexus[3] NOT
plexus-container-default[4]. Which are basically the same package.
Though the sisu.plexus one is a bit different, and is the one Maven
itself uses. I need to swap some stuff out for Modello and see if that
fixes my issue with ModelloCli, so I can generate java from .mdo files.

There is a similar situation with eclipse-aether[5] and
maven-resolver[6]. But that is more Maven specific, as Modello only
uses Plexus not Aether.

Funny enough I started out packaging Maven for Gradle. I am making
more progress with Maven cli mvn [1] than I am with Gradle's cli :)

Maven from source on Gentoo has been voodoo for years till 2018!!!

1. https://github.com/Obsidian-StudiosInc/os-xtoo/issues/54
2. https://github.com/Obsidian-StudiosInc/os-xtoo/issues/56
3. https://github.com/eclipse/sisu.plexus/tree/master/org.eclipse.sisu.plexus
4. https://github.com/codehaus-plexus/plexus-containers/tree/master/plexus-container-default
5. https://github.com/eclipse/aether-core
6. https://github.com/apache/maven-resolver

-- 
William L. Thomson Jr.

Re: Process maven mdo files via ModelloCLI

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Mon, 25 Jun 2018 08:24:58 +0200
Michael Osipov <mi...@apache.org> wrote:
>
> William,
> 
> my first an foremost question is why do you need this? 

Maven and parts are needed as dependencies for Gradle and Netbeans.

> Aren't you  satisfied with the signed binary released we provide?

No, I do not run a binary distribution. Why should Maven be one of the
sole binaries? The only exception is the JDK itself, for other reasons.

> Even if you pursue the from-source-BSD-approach, it is perfectly fine
> to use packages as-is. 

Pre-generated sources are bad. One should have a means to build from
version control for a variety of reasons. Java has a horrendous habit
of developing things that require bootstrapping, needlessly...
The JDK is one thing, but anything built atop should have a better way.
Most of these generate Java code or bytecode from something else.

> This is what I recommend on the FreeBSD Java mailing list. Moreover,
> the general consensus from us is that we do not support packages not
> carrying the Git commit or our signature. Debian guys do abnormal
> things by splitting every single dependency of Maven into a deb file.

I am not looking for support. I am looking to understand things Maven
is built atop and how its developed. If one makes changes to a mdo
file. They must run Maven to generate the Java file. Plus then write
tests to ensure that what Modello generated was what was expected.
Rather than writing pure Java from the start...

In a nutshell to develop maven, you must be able to run maven. To use
said plugins to generate Java code. Which a choice was made to use that
format over others. Which can always be changed and eliminates any
issues I have with build.

It is not like Modello's .mdo files are in wide use. I cannot find them
anywhere other than Maven, and even worse a circular dep issue with
Plexus.
https://github.com/codehaus-plexus/plexus-containers/issues/11

That is poor design IMHO. Maven could drop using Modello mdo files for
some other format for Maven build. Which would not effect other stuff.
It likely would not change work flow described above. As you swap out
the modello-maven-plugin for javacc, antlr, xjc, or some other plugin.
Lots of Generators to choose from that are more common.

> These days compiling Java software w/ pure javac is a pain. 

Maybe how you do it, but using what I have been working on for sometime
it is anything but. I was able to package most of Netbeans in a much
more simplistic way using a completely different build system.

You should look at some of my packages and tell me that is complex. Or
even the eclasses. They are trivial compared to most other build
systems. It could even be used on other distros or OS.
https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-java/

Netbeans ones are even less due to its eclass
https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/nb-ide
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass

> Even if this will work, you'd still need -- as you have said -- all
> dependencies from Maven. So you still rely on binary files.

Nice assumption, but you are wrong. I build ALL dependencies from
source.... I use no binaries, except for javacc only to build javacc
from source within its package. Its the only one using a pre-build
binary that resides within source releases.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/javacc/javacc-9999.ebuild#L39

Which I have a request into to stop requiring bootstrap.
https://github.com/javacc/javacc/issues/40

Other stuff I can build to build itself like Groovy, antlr and many
other generators. Though I do dislike bootstrapping and believe it can
be avoided in many cases. Sadly others do not care about such and
rather continue with the bad practices of requiring bootstrapping.

-- 
William L. Thomson Jr.