You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Shane Isbell <sh...@gmail.com> on 2008/08/14 18:01:27 UTC
Importing of DependencyManagement Info
I've been refactoring more of the project builder code and encountered a
rule that if a dependencyManagement/dependencies/dependency element has
type=pom and scope=import, the dependency management section of that
dependency should be imported into the containing pom model. This is a
one-off rule that doesn't easily fit into the new project builder which
keeps all pom specific rules in the PomClassicTransformer class. This type
of behavior could be handled instead by mixins/imports within the latest
maven-shared-model code. The way this would work is that you could use a
mavenImport tag in the dependencyManagement section of the pom and then the
framework would handle importing the xml fragment containing the dependency
info. Thoughts?
Shane
Re: Importing of DependencyManagement Info
Posted by Brian Fox <br...@reply.infinity.nu>.
Shane has reworked maven project with an eye towards these use cases.
This stuff is in maven 3.0
Sent from my iPhone
On Aug 25, 2008, at 8:26 PM, Ralph Goers <Ra...@dslextreme.com>
wrote:
> I'm still confused. If I had thought that it could be done that way
> I would have done it in the first place. How does that get past
> schema checking? Or are you adding it to the xsd somewhere?
>
> Shane Isbell wrote:
>> Basically, you just put in <mavenImport id=""/> into the pom. The
>> id references an external pom snippet and injects it. Right now,
>> there is nothing that can resolve these snippets so that's one
>> thing that needs to be added (I'm thinking Mercury here).
>> Shane
>>
>> On 8/25/08, *Ralph Goers* <Ralph.Goers@dslextreme.com <mailto:Ralph.Goers@dslextreme.com
>> >> wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Shane Isbell wrote:
>>
>> I've been refactoring more of the project builder
>> code and encountered a
>> rule that if a
>> dependencyManagement/dependencies/dependency
>> element has
>> type=pom and scope=import, the dependency
>> management section of that
>> dependency should be imported into the containing
>> pom model. This is a
>> one-off rule that doesn't easily fit into the new
>> project builder which
>> keeps all pom specific rules in the
>> PomClassicTransformer class. This type
>> of behavior could be handled instead by
>> mixins/imports within the latest
>> maven-shared-model code. The way this would work
>> is that you could use a
>> mavenImport tag in the dependencyManagement
>> section of the pom and then the
>> framework would handle importing the xml fragment
>> containing the dependency
>> info. Thoughts?
>>
>> Shane
>>
>> I'm not sure I completely follow. Can you provide an
>> example?
>>
>>
>> Shane, can you please provide an example of the way it
>> would work?
>>
>>
>> I'm still waiting for an example. I'd really like to
>> understand what you are talking about.
>>
>> Pinging one more time. I'd really like to understand this.
>>
>> Ralph
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Shane Isbell <sh...@gmail.com>.
On 8/25/08, Ralph Goers <Ra...@dslextreme.com> wrote:
>
> I'm still confused. If I had thought that it could be done that way I would
> have done it in the first place. How does that get past schema checking? Or
> are you adding it to the xsd somewhere?
The mavenImport tag is processed in the project builder prior to passing it
to the Xpp3Reader, which then does the schema validation. There is still the
outstanding problem that these import tags could not be directly read by
modello.
Shane
Shane Isbell wrote:
>
>> Basically, you just put in <mavenImport id=""/> into the pom. The id
>> references an external pom snippet and injects it. Right now, there is
>> nothing that can resolve these snippets so that's one thing that needs to be
>> added (I'm thinking Mercury here).
>> Shane
>>
>> On 8/25/08, *Ralph Goers* <Ralph.Goers@dslextreme.com <mailto:
>> Ralph.Goers@dslextreme.com>> wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Ralph Goers wrote:
>>
>>
>>
>> Shane Isbell wrote:
>>
>> I've been refactoring more of the project builder
>> code and encountered a
>> rule that if a
>> dependencyManagement/dependencies/dependency
>> element has
>> type=pom and scope=import, the dependency
>> management section of that
>> dependency should be imported into the containing
>> pom model. This is a
>> one-off rule that doesn't easily fit into the new
>> project builder which
>> keeps all pom specific rules in the
>> PomClassicTransformer class. This type
>> of behavior could be handled instead by
>> mixins/imports within the latest
>> maven-shared-model code. The way this would work
>> is that you could use a
>> mavenImport tag in the dependencyManagement
>> section of the pom and then the
>> framework would handle importing the xml fragment
>> containing the dependency
>> info. Thoughts?
>>
>> Shane
>>
>> I'm not sure I completely follow. Can you provide an
>> example?
>>
>>
>> Shane, can you please provide an example of the way it
>> would work?
>>
>>
>> I'm still waiting for an example. I'd really like to
>> understand what you are talking about.
>>
>> Pinging one more time. I'd really like to understand this.
>>
>> Ralph
>>
>>
>>
Re: Importing of DependencyManagement Info
Posted by Ralph Goers <Ra...@dslextreme.com>.
I'm still confused. If I had thought that it could be done that way I
would have done it in the first place. How does that get past schema
checking? Or are you adding it to the xsd somewhere?
Shane Isbell wrote:
> Basically, you just put in <mavenImport id=""/> into the pom. The id
> references an external pom snippet and injects it. Right now, there is
> nothing that can resolve these snippets so that's one thing that needs
> to be added (I'm thinking Mercury here).
>
> Shane
>
>
> On 8/25/08, *Ralph Goers* <Ralph.Goers@dslextreme.com
> <ma...@dslextreme.com>> wrote:
>
>
>
> Ralph Goers wrote:
>
>
>
> Ralph Goers wrote:
>
>
>
> Ralph Goers wrote:
>
>
>
> Shane Isbell wrote:
>
> I've been refactoring more of the project builder
> code and encountered a
> rule that if a
> dependencyManagement/dependencies/dependency
> element has
> type=pom and scope=import, the dependency
> management section of that
> dependency should be imported into the containing
> pom model. This is a
> one-off rule that doesn't easily fit into the new
> project builder which
> keeps all pom specific rules in the
> PomClassicTransformer class. This type
> of behavior could be handled instead by
> mixins/imports within the latest
> maven-shared-model code. The way this would work
> is that you could use a
> mavenImport tag in the dependencyManagement
> section of the pom and then the
> framework would handle importing the xml fragment
> containing the dependency
> info. Thoughts?
>
> Shane
>
>
> I'm not sure I completely follow. Can you provide an
> example?
>
>
> Shane, can you please provide an example of the way it
> would work?
>
>
> I'm still waiting for an example. I'd really like to
> understand what you are talking about.
>
> Pinging one more time. I'd really like to understand this.
>
> Ralph
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Brett Porter <br...@apache.org>.
Hi Shane,
A few questions on this:
On 26/08/2008, at 12:26 AM, Shane Isbell wrote:
> Basically, you just put in <mavenImport id=""/> into the pom. The id
> references an external pom snippet and injects it.
What does the id look like? Is the snippet a standalone file, or is it
referenced from an existing POM? And if so, how do you declare the
snippet in the existing POM?
> Right now, there is
> nothing that can resolve these snippets so that's one thing that
> needs to be
> added (I'm thinking Mercury here).
Would this be similar to referencing parent POMs? Could the same logic
be used, whether backed by Mercury or the current maven-artifact?
Cheers,
Brett
--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Shane Isbell <sh...@gmail.com>.
Basically, you just put in <mavenImport id=""/> into the pom. The id
references an external pom snippet and injects it. Right now, there is
nothing that can resolve these snippets so that's one thing that needs to be
added (I'm thinking Mercury here).
Shane
On 8/25/08, Ralph Goers <Ra...@dslextreme.com> wrote:
>
>
>
> Ralph Goers wrote:
>
>>
>>
>> Ralph Goers wrote:
>>
>>>
>>>
>>> Ralph Goers wrote:
>>>
>>>>
>>>>
>>>> Shane Isbell wrote:
>>>>
>>>>> I've been refactoring more of the project builder code and encountered
>>>>> a
>>>>> rule that if a dependencyManagement/dependencies/dependency element has
>>>>> type=pom and scope=import, the dependency management section of that
>>>>> dependency should be imported into the containing pom model. This is a
>>>>> one-off rule that doesn't easily fit into the new project builder which
>>>>> keeps all pom specific rules in the PomClassicTransformer class. This
>>>>> type
>>>>> of behavior could be handled instead by mixins/imports within the
>>>>> latest
>>>>> maven-shared-model code. The way this would work is that you could use
>>>>> a
>>>>> mavenImport tag in the dependencyManagement section of the pom and then
>>>>> the
>>>>> framework would handle importing the xml fragment containing the
>>>>> dependency
>>>>> info. Thoughts?
>>>>>
>>>>> Shane
>>>>>
>>>>>
>>>> I'm not sure I completely follow. Can you provide an example?
>>>>
>>>>
>>>> Shane, can you please provide an example of the way it would work?
>>>
>>>
>>> I'm still waiting for an example. I'd really like to understand what you
>> are talking about.
>>
>> Pinging one more time. I'd really like to understand this.
>
> Ralph
>
Re: Importing of DependencyManagement Info
Posted by Ralph Goers <Ra...@dslextreme.com>.
Ralph Goers wrote:
>
>
> Ralph Goers wrote:
>>
>>
>> Ralph Goers wrote:
>>>
>>>
>>> Shane Isbell wrote:
>>>> I've been refactoring more of the project builder code and
>>>> encountered a
>>>> rule that if a dependencyManagement/dependencies/dependency element
>>>> has
>>>> type=pom and scope=import, the dependency management section of that
>>>> dependency should be imported into the containing pom model. This is a
>>>> one-off rule that doesn't easily fit into the new project builder
>>>> which
>>>> keeps all pom specific rules in the PomClassicTransformer class.
>>>> This type
>>>> of behavior could be handled instead by mixins/imports within the
>>>> latest
>>>> maven-shared-model code. The way this would work is that you could
>>>> use a
>>>> mavenImport tag in the dependencyManagement section of the pom and
>>>> then the
>>>> framework would handle importing the xml fragment containing the
>>>> dependency
>>>> info. Thoughts?
>>>>
>>>> Shane
>>>>
>>> I'm not sure I completely follow. Can you provide an example?
>>>
>>>
>> Shane, can you please provide an example of the way it would work?
>>
>>
> I'm still waiting for an example. I'd really like to understand what
> you are talking about.
>
Pinging one more time. I'd really like to understand this.
Ralph
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Ralph Goers <Ra...@dslextreme.com>.
Ralph Goers wrote:
>
>
> Ralph Goers wrote:
>>
>>
>> Shane Isbell wrote:
>>> I've been refactoring more of the project builder code and
>>> encountered a
>>> rule that if a dependencyManagement/dependencies/dependency element has
>>> type=pom and scope=import, the dependency management section of that
>>> dependency should be imported into the containing pom model. This is a
>>> one-off rule that doesn't easily fit into the new project builder which
>>> keeps all pom specific rules in the PomClassicTransformer class.
>>> This type
>>> of behavior could be handled instead by mixins/imports within the
>>> latest
>>> maven-shared-model code. The way this would work is that you could
>>> use a
>>> mavenImport tag in the dependencyManagement section of the pom and
>>> then the
>>> framework would handle importing the xml fragment containing the
>>> dependency
>>> info. Thoughts?
>>>
>>> Shane
>>>
>> I'm not sure I completely follow. Can you provide an example?
>>
>>
> Shane, can you please provide an example of the way it would work?
>
>
I'm still waiting for an example. I'd really like to understand what
you are talking about.
Ralph
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Ralph Goers <Ra...@dslextreme.com>.
Ralph Goers wrote:
>
>
> Shane Isbell wrote:
>> I've been refactoring more of the project builder code and encountered a
>> rule that if a dependencyManagement/dependencies/dependency element has
>> type=pom and scope=import, the dependency management section of that
>> dependency should be imported into the containing pom model. This is a
>> one-off rule that doesn't easily fit into the new project builder which
>> keeps all pom specific rules in the PomClassicTransformer class. This
>> type
>> of behavior could be handled instead by mixins/imports within the latest
>> maven-shared-model code. The way this would work is that you could use a
>> mavenImport tag in the dependencyManagement section of the pom and
>> then the
>> framework would handle importing the xml fragment containing the
>> dependency
>> info. Thoughts?
>>
>> Shane
>>
> I'm not sure I completely follow. Can you provide an example?
>
>
Shane, can you please provide an example of the way it would work?
Ralph
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by Ralph Goers <Ra...@dslextreme.com>.
Shane Isbell wrote:
> I've been refactoring more of the project builder code and encountered a
> rule that if a dependencyManagement/dependencies/dependency element has
> type=pom and scope=import, the dependency management section of that
> dependency should be imported into the containing pom model. This is a
> one-off rule that doesn't easily fit into the new project builder which
> keeps all pom specific rules in the PomClassicTransformer class. This type
> of behavior could be handled instead by mixins/imports within the latest
> maven-shared-model code. The way this would work is that you could use a
> mavenImport tag in the dependencyManagement section of the pom and then the
> framework would handle importing the xml fragment containing the dependency
> info. Thoughts?
>
> Shane
>
I'm not sure I completely follow. Can you provide an example?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Importing of DependencyManagement Info
Posted by John Casey <jd...@commonjava.org>.
Aside from the potential for solving this in the new project builder
code, the existing implementation has a major limitation:
If a parent POM specified a child in its dependencyManagement section
with scope == import, and that child specifies this parent POM in its
<parent/> section, then you wind up with an infinite loop in the old
project-builder code. This is because the parent project instance isn't
quite built at the point where it tries to import dependencyManagement
from those dependencies with scope == import. If one of those
dependencies refers to the current project as its parent, then it will
try to build the current/parent POM once again, which will cause the
cycle to start all over again from the top.
If we can find an elegant way to handle the import problem, I'm all for
it. Particularly if we can backport it (or at least the concept) to
2.0.x/2.1.x. ;-)
-john
Shane Isbell wrote:
> I've been refactoring more of the project builder code and encountered a
> rule that if a dependencyManagement/dependencies/dependency element has
> type=pom and scope=import, the dependency management section of that
> dependency should be imported into the containing pom model. This is a
> one-off rule that doesn't easily fit into the new project builder which
> keeps all pom specific rules in the PomClassicTransformer class. This type
> of behavior could be handled instead by mixins/imports within the latest
> maven-shared-model code. The way this would work is that you could use a
> mavenImport tag in the dependencyManagement section of the pom and then the
> framework would handle importing the xml fragment containing the dependency
> info. Thoughts?
>
> Shane
>
--
John Casey
Developer, PMC Member - Apache Maven (http://maven.apache.org)
Blog: http://www.ejlife.net/blogs/buildchimp/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org