On Tue, 2005-10-25 at 20:54 +0000, John Fallows wrote:
> On 10/5/05, Jason van Zyl <[EMAIL PROTECTED]> wrote:
> > On Wed, 2005-10-05 at 18:56 +0000, John Fallows wrote:
> > > Is it possible to customize the syntax of pom.xml without impacting
> > > the rest of the Maven2?
> >
> > In theory yes, but would we want to allow that I don't know. What do you
> > want to customize? Is is something generally useful that might be
> > incorporated into Maven itself?
> 
> Not really - it's more of an intermediate step to aid initial Maven2
> adoption for an existing build system. Over time we'll hopefully be able to
> consume pom.xml directly. We'll be sure to file any necessary enhancements
> or bugs that would otherwise prevent our migration to the standard
> pom.xmlsyntax.

You have some specific examples?

> To get this working, we'd register a custom implementation with the same
> <role>, but a different <role-hint>, say
> <role-hint>custom-syntax</role-hint>?

Yes, but there the ProjectBuilder is made up of many other components so
we might need to document something for you.

> Then we would have to directly update META-INF/plexus/components.xml to add
> that <role-hint> to the <requirements> section of whatever consumes the
> MavenProjectBuilder <role>, right?

Something we've been planning for a while in plexus is to always use a
role hint because this is one of the cases where we thought we would
only ever have one implementation so all the components that use the
project builder only pull it in by its role. So we would have to change
that everywhere to use a role+role-hint so that you could do what you
need. Or if it's just your implementation then you can just knock out
the default one we provide. Actually that would probably be easier to
start.

> Does that mean we'd need to update the following from
> maven-core-2.0.jar!/META-INF/plexus/components.xml?
> 
> <component>
> <role>org.apache.maven.Maven</role>
> <implementation>org.apache.maven.DefaultMaven</implementation>
> <requirements>
> <requirement>
> <role>org.apache.maven.project.MavenProjectBuilder</role>
> <role-hint>custom-syntax</role-hint>
> </requirement>
> <requirement>
> <role>org.apache.maven.lifecycle.LifecycleExecutor</role>
> </requirement>
> <requirement>
> <role>org.apache.maven.usability.diagnostics.ErrorDiagnostics</role>
> </requirement>
> <requirement>
> <role>org.apache.maven.execution.RuntimeInformation</role>
> </requirement>
> </requirements>
> </component>

If you just moved ours out of the way and named yours the same as ours
you could quickly try your new version. You would simply need to change
the implementation element to point to your class instead of ours. The
rest of the requires elements would remain the same as they point to the
interface.

> I was wondering if it was possible to put this in a different JAR, and leave
> maven-core-2.0.jar unchanged. This seems to imply that the <role>
> org.apache.maven.Maven</role> would need it's own <role-hint> as well. Is
> there a convenient way to get Maven2 to use a custom <role-hint> when
> discovering the <role>org.apache.maven.Maven</role> during "mvn" invocation?

You would need to knock our implementation out. The easiest way to do
this I would think is to put your implementation into maven-project and
rebuild the JAR. We haven't exposed plexus' overriding mechanism in
Maven. This allows a user configuration to override anything in the
component descriptors found inside the JARs. If you want to raise this
issue in JIRA we might be able to look at it. I think someone else asked
about a custom implementation of a component so using plexus' override
mechanism would make this a lot easier.

For anything with multiple implementations you use role hints. But we
are now thinking you'll never know when you will expand so we're moving
toward using role hints all the time and just having a default hint of
"default" in most places to make situations like this easier to deal
with.

Hope that helps. I'm in IRC if you need any more in depth help.

> Kind Regards,
> John Fallows
> 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > --
> > jvz.
> >
> > Jason van Zyl
> > jason at maven.org <http://maven.org>
> > http://maven.apache.org
> >
> > you are never dedicated to something you have complete confidence in.
> > No one is fanatically shouting that the sun is going to rise tomorrow.
> > They know it is going to rise tomorrow. When people are fanatically
> > dedicated to political or religious faiths or any other kind of
> > dogmas or goals, it's always because these dogmas or
> > goals are in doubt.
> >
> > -- Robert Pirzig, Zen and the Art of Motorcycle Maintenance
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

the course of true love never did run smooth ...

 -- Shakespeare


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to