You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Gilles Scokart <gs...@gmail.com> on 2008/02/13 09:10:01 UTC
Store pom dependency Managment in extra data
In the rewrite of the pom parser, I would like to store the maven dependency
managment (and maybe also the properties) into the extra data of the
moduleRevisionId.
That way, the corresponding ivy module descriptor would contains all the
info coming from the pom. I think it might be usefull when it is serialized
are reused from the cache (thought I'm not sure if it's the original pom or
the serialized ivy.xml that is used in that case).
However, I have noticed that the extra attributes are used to compare
moduleRevisionId, and I fear that might bring some problem. Does it? And
is it normal to use the extra attributes in this comparison?
--
Gilles Scokart
Re: Store pom dependency Managment in extra data
Posted by Xavier Hanin <xa...@gmail.com>.
On Thu, Feb 14, 2008 at 10:49 AM, Gilles Scokart <gs...@gmail.com> wrote:
>
>
> > -----Original Message-----
> > From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> > Sent: jeudi 14 février 2008 9:44
> > To: Ant Developers List
> > Subject: Re: Store pom dependency Managment in extra data
> >
> > I think we need to distinguish two kind of extra metadata: those used to
> > identify the module, and those which are pure information. IMO extra
> > attributes on the info tag are good candidates for the first kind of
> extra
> > meta information:
> > - because it's how they work now
> > - because the info tag attributes are mainly identifying the module.
> >
> > So I think it's better to distinguish the other kind of extra
> information,
> > and you seem to agree, so this is fine :-)
> >
> > Now about how to define these extra information, how to name them, and
> how
> > they can be used. IMO, if we introduce something in the core for maven 2
> > compatibility, it's better to try to find a use case for users who use
> Ivy
> > files only. So I think we need at least to find a syntax in Ivy files to
> > support setting this additional extra information.
>
> My idea was to use the attribute of the info tag as identifier, like it is
> now. And put to other values under the info
> tag, like you have now the license, the repository and so on.
>
> We could put all those info into an extraInfo.
You can already put whatever you want in the description tag (which has
xs:any children in the xsd). So the difference would only be that this
information is parsed by Ivy, but how users could use them, if they aren't
properties? Only when using Ivy API?
>
> >
> > Now about calling them properties and making them available as
> properties in
> > the Ivy file. What I like about that is that:
> > - it uses an existing concept in Ivy, so we don't need to define a new
> one
> > - it answers to a use case that at least I've had before (so I guess
> other
> > users have too), where I need a property in an ivy file and don't want
> to
> > define it outside my ivy file
> >
> > About the added complexity, I think we need to distinguish two kind of
> > complexity: complexity in Ivy code, and complexity for users. IMO, it's
> > something pretty easy to understand by users, because we reuse an
> existing
> > and well known concept. In Ivy code, I don't think it make it really
> more
> > complex, if we allow to use a property only after it is declared (so if
> the
> > property definition comes after the info tag in the xsd, we won't be
> able to
> > use locally defined properties in the info tag). We already do this kind
> of
> > substitution for globally defined properties, and it can be easily
> factored
> > at the beginning of the startElement method, so I don't see much added
> > complexity here.
> >
> > So I'm still in favor of this properties support in Ivy files. Did I
> manage
> > to change your mind ? :-)
>
> Well, I'm now -0.1 for this. I understand the use case, and I already
> faced it as well, but I still found the concept
> of properties already quiet loaded (ant properties, settings properties,
> each with potentially different overwrite rules
> and scoping).
Yes, but in this case it's actually just simpler: properties are defined in
the same file as where they are used. I agree that we still have to deal
with overwrite, but I don't think it's a major issue.
Xavier, trying to get at least a 0.1++ :-)
>
> Let see what the other things about it?
>
> Gilles
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
RE: Store pom dependency Managment in extra data
Posted by Gilles Scokart <gs...@gmail.com>.
> -----Original Message-----
> From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> Sent: jeudi 14 février 2008 9:44
> To: Ant Developers List
> Subject: Re: Store pom dependency Managment in extra data
>
> I think we need to distinguish two kind of extra metadata: those used to
> identify the module, and those which are pure information. IMO extra
> attributes on the info tag are good candidates for the first kind of extra
> meta information:
> - because it's how they work now
> - because the info tag attributes are mainly identifying the module.
>
> So I think it's better to distinguish the other kind of extra information,
> and you seem to agree, so this is fine :-)
>
> Now about how to define these extra information, how to name them, and how
> they can be used. IMO, if we introduce something in the core for maven 2
> compatibility, it's better to try to find a use case for users who use Ivy
> files only. So I think we need at least to find a syntax in Ivy files to
> support setting this additional extra information.
My idea was to use the attribute of the info tag as identifier, like it is now. And put to other values under the info
tag, like you have now the license, the repository and so on.
We could put all those info into an extraInfo.
>
> Now about calling them properties and making them available as properties in
> the Ivy file. What I like about that is that:
> - it uses an existing concept in Ivy, so we don't need to define a new one
> - it answers to a use case that at least I've had before (so I guess other
> users have too), where I need a property in an ivy file and don't want to
> define it outside my ivy file
>
> About the added complexity, I think we need to distinguish two kind of
> complexity: complexity in Ivy code, and complexity for users. IMO, it's
> something pretty easy to understand by users, because we reuse an existing
> and well known concept. In Ivy code, I don't think it make it really more
> complex, if we allow to use a property only after it is declared (so if the
> property definition comes after the info tag in the xsd, we won't be able to
> use locally defined properties in the info tag). We already do this kind of
> substitution for globally defined properties, and it can be easily factored
> at the beginning of the startElement method, so I don't see much added
> complexity here.
>
> So I'm still in favor of this properties support in Ivy files. Did I manage
> to change your mind ? :-)
Well, I'm now -0.1 for this. I understand the use case, and I already faced it as well, but I still found the concept
of properties already quiet loaded (ant properties, settings properties, each with potentially different overwrite rules
and scoping).
Let see what the other things about it?
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Store pom dependency Managment in extra data
Posted by Xavier Hanin <xa...@gmail.com>.
I think we need to distinguish two kind of extra metadata: those used to
identify the module, and those which are pure information. IMO extra
attributes on the info tag are good candidates for the first kind of extra
meta information:
- because it's how they work now
- because the info tag attributes are mainly identifying the module.
So I think it's better to distinguish the other kind of extra information,
and you seem to agree, so this is fine :-)
Now about how to define these extra information, how to name them, and how
they can be used. IMO, if we introduce something in the core for maven 2
compatibility, it's better to try to find a use case for users who use Ivy
files only. So I think we need at least to find a syntax in Ivy files to
support setting this additional extra information.
Now about calling them properties and making them available as properties in
the Ivy file. What I like about that is that:
- it uses an existing concept in Ivy, so we don't need to define a new one
- it answers to a use case that at least I've had before (so I guess other
users have too), where I need a property in an ivy file and don't want to
define it outside my ivy file
About the added complexity, I think we need to distinguish two kind of
complexity: complexity in Ivy code, and complexity for users. IMO, it's
something pretty easy to understand by users, because we reuse an existing
and well known concept. In Ivy code, I don't think it make it really more
complex, if we allow to use a property only after it is declared (so if the
property definition comes after the info tag in the xsd, we won't be able to
use locally defined properties in the info tag). We already do this kind of
substitution for globally defined properties, and it can be easily factored
at the beginning of the startElement method, so I don't see much added
complexity here.
So I'm still in favor of this properties support in Ivy files. Did I manage
to change your mind ? :-)
Xavier
On Thu, Feb 14, 2008 at 8:51 AM, Gilles Scokart <gs...@gmail.com> wrote:
> I think that storing some extra free values is nice, but I'm not convinced
> that using real properties is a good thing. It add some complexity to the
> parsing of the ivy files (where can you use property, can use it inside
> proerty declaration for instance). If I look at maven pom, it is one of
> the
> thing that make it more complexe, with making it more powerfull.
>
> I think the extra value should just be values. For instance, if someone
> want to store a bug tracking url, an organisation specific code, or
> anything
> else in its ivy file, he could store it there.
>
> I thought the extra data could be used for that. In the doc [1], it is
> not
> clear that when you use extra data in the info tag, you MUST use it also
> in
> the dependency tag of the module that use it. I think that should be
> enhanced.
>
> Anyway, I will add an extraInfo field to the module descriptor. Maybe, we
> can even retrofit all the content of info into it.
>
>
> [1] http://ant.apache.org/ivy/history/latest-milestone/concept.html#extra
>
> Gilles
>
>
> 2008/2/13, Xavier Hanin <xa...@gmail.com>:
> >
> > On Feb 13, 2008 9:10 AM, Gilles Scokart <gs...@gmail.com> wrote:
> >
> > > In the rewrite of the pom parser, I would like to store the maven
> > > dependency
> > > managment (and maybe also the properties) into the extra data of the
> > > moduleRevisionId.
> > >
> > > That way, the corresponding ivy module descriptor would contains all
> the
> > > info coming from the pom. I think it might be usefull when it is
> > > serialized
> > > are reused from the cache (thought I'm not sure if it's the original
> pom
> > > or
> > > the serialized ivy.xml that is used in that case).
> > >
> > > However, I have noticed that the extra attributes are used to compare
> > > moduleRevisionId, and I fear that might bring some problem. Does it?
> >
> >
> > Probably.
> >
> >
> >
> > > And
> > > is it normal to use the extra attributes in this comparison?
> >
> >
> > I think so, many time people use extra attributes in the info tag to add
> > extra identification attributes. I don't really think putty meta
> > information
> > such as the dependency management information in extra attributes is a
> > good
> > fit. But I like the idea of keeping data from dependency management
> > section.
> > Maybe a good way to do it would be to add a Map of properties to the
> > module
> > descriptor. This would be another area of flexibility for Ivy users, and
> > I'd
> > even see usage for Ivy files, if we actually make them usable as
> > properties
> > in the Ivy file. Something like:
> > <ivy-module version="2.0">
> > <info org="foo" name="bar" />
> > <property name="foo.baz.revision" value="1.0.4" />
> > <dependencies>
> > <dependency org="foo" name="baz-api" rev="${foo.baz.revision}" />
> > <dependency org="foo" name="baz-main" rev="${foo.baz.revision}" />
> > <dependency org="foo" name="baz-other" rev="${foo.baz.revision}" />
> > </dependencies>
> > </ivy-module>
> >
> > WDYT?
> >
> > Xavier
> >
> > >
> > >
> > > --
> > > Gilles Scokart
> > >
> >
> >
> >
> >
> > --
> > Xavier Hanin - Independent Java Consultant
> > http://xhab.blogspot.com/
> > http://ant.apache.org/ivy/
> > http://www.xoocode.org/
> >
>
>
>
> --
> Gilles Scokart
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/
Re: Store pom dependency Managment in extra data
Posted by Gilles Scokart <gs...@gmail.com>.
I think that storing some extra free values is nice, but I'm not convinced
that using real properties is a good thing. It add some complexity to the
parsing of the ivy files (where can you use property, can use it inside
proerty declaration for instance). If I look at maven pom, it is one of the
thing that make it more complexe, with making it more powerfull.
I think the extra value should just be values. For instance, if someone
want to store a bug tracking url, an organisation specific code, or anything
else in its ivy file, he could store it there.
I thought the extra data could be used for that. In the doc [1], it is not
clear that when you use extra data in the info tag, you MUST use it also in
the dependency tag of the module that use it. I think that should be
enhanced.
Anyway, I will add an extraInfo field to the module descriptor. Maybe, we
can even retrofit all the content of info into it.
[1] http://ant.apache.org/ivy/history/latest-milestone/concept.html#extra
Gilles
2008/2/13, Xavier Hanin <xa...@gmail.com>:
>
> On Feb 13, 2008 9:10 AM, Gilles Scokart <gs...@gmail.com> wrote:
>
> > In the rewrite of the pom parser, I would like to store the maven
> > dependency
> > managment (and maybe also the properties) into the extra data of the
> > moduleRevisionId.
> >
> > That way, the corresponding ivy module descriptor would contains all the
> > info coming from the pom. I think it might be usefull when it is
> > serialized
> > are reused from the cache (thought I'm not sure if it's the original pom
> > or
> > the serialized ivy.xml that is used in that case).
> >
> > However, I have noticed that the extra attributes are used to compare
> > moduleRevisionId, and I fear that might bring some problem. Does it?
>
>
> Probably.
>
>
>
> > And
> > is it normal to use the extra attributes in this comparison?
>
>
> I think so, many time people use extra attributes in the info tag to add
> extra identification attributes. I don't really think putty meta
> information
> such as the dependency management information in extra attributes is a
> good
> fit. But I like the idea of keeping data from dependency management
> section.
> Maybe a good way to do it would be to add a Map of properties to the
> module
> descriptor. This would be another area of flexibility for Ivy users, and
> I'd
> even see usage for Ivy files, if we actually make them usable as
> properties
> in the Ivy file. Something like:
> <ivy-module version="2.0">
> <info org="foo" name="bar" />
> <property name="foo.baz.revision" value="1.0.4" />
> <dependencies>
> <dependency org="foo" name="baz-api" rev="${foo.baz.revision}" />
> <dependency org="foo" name="baz-main" rev="${foo.baz.revision}" />
> <dependency org="foo" name="baz-other" rev="${foo.baz.revision}" />
> </dependencies>
> </ivy-module>
>
> WDYT?
>
> Xavier
>
> >
> >
> > --
> > Gilles Scokart
> >
>
>
>
>
> --
> Xavier Hanin - Independent Java Consultant
> http://xhab.blogspot.com/
> http://ant.apache.org/ivy/
> http://www.xoocode.org/
>
--
Gilles Scokart
Re: Store pom dependency Managment in extra data
Posted by Xavier Hanin <xa...@gmail.com>.
On Feb 13, 2008 9:10 AM, Gilles Scokart <gs...@gmail.com> wrote:
> In the rewrite of the pom parser, I would like to store the maven
> dependency
> managment (and maybe also the properties) into the extra data of the
> moduleRevisionId.
>
> That way, the corresponding ivy module descriptor would contains all the
> info coming from the pom. I think it might be usefull when it is
> serialized
> are reused from the cache (thought I'm not sure if it's the original pom
> or
> the serialized ivy.xml that is used in that case).
>
> However, I have noticed that the extra attributes are used to compare
> moduleRevisionId, and I fear that might bring some problem. Does it?
Probably.
> And
> is it normal to use the extra attributes in this comparison?
I think so, many time people use extra attributes in the info tag to add
extra identification attributes. I don't really think putty meta information
such as the dependency management information in extra attributes is a good
fit. But I like the idea of keeping data from dependency management section.
Maybe a good way to do it would be to add a Map of properties to the module
descriptor. This would be another area of flexibility for Ivy users, and I'd
even see usage for Ivy files, if we actually make them usable as properties
in the Ivy file. Something like:
<ivy-module version="2.0">
<info org="foo" name="bar" />
<property name="foo.baz.revision" value="1.0.4" />
<dependencies>
<dependency org="foo" name="baz-api" rev="${foo.baz.revision}" />
<dependency org="foo" name="baz-main" rev="${foo.baz.revision}" />
<dependency org="foo" name="baz-other" rev="${foo.baz.revision}" />
</dependencies>
</ivy-module>
WDYT?
Xavier
>
>
> --
> Gilles Scokart
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/