You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <br...@apache.org> on 2005/04/14 15:49:27 UTC

Re: maven and ivy

(context - email from Xavier Hanin, Ivy developer, regarding using m2
POMs in Ivy)

Xavier Hanin wrote:

> I understand, I have no request for the moment cause I don't have
> enough knowledge of m2 poms. And that's why I am asking for help from
> your side... if you could point me to a doc where i could see how 
> scope mapping is described in poms, i think i would be able to make
> ivy understand poms.

It's autogenerated, and needs some improvement:
http://maven.apache.org/maven2/project-descriptor.html#Dependency
example of scope:
http://maven.apache.org/maven2/getting-started.html#Multiple_Modules
(towards the end)

In m2, scope is the inclusion of JARs depending on whether they are used
to compile, run, or test the project - profile could be reused for that,
but they have special meaning (ie compile is runtime and test, runtime
is test, etc). As I'll explain, it is different from your configuration
directive.

>> Though the minimal valid POM is really just:
>>
>> <project>
>>  <groupId>...</groupId>
>>  <artifactId>...</artifactId>
>>  <version>...</version>
>>  <dependencies />
>> </project>
>>
>> (where dependencies is optional) - so it's not too much to ask :)
>>  
>>
> Not too much, you're right ! We have the same minimal requirements...
> maybe we'll finally manage to only have poms. It's too early for the
> moment, but we are not against the idea if it's better for the community.

Ok, I'll look forward to hearing from you.

>
> Actually "test" doesn't mean anything for ivy. Nothing more than
> "default", or "myscope". Ivy let the user define their own
> configurations depending on their needs. It only uses them to
> structure the dependencies, to separate them in several reusable sets.
> It is used too avoid getting dependencies which are not actually
> required, which otherwise could be very expensive (in download time,
> especially), with transitive dependencies.
>
Ok, they are completely different. This is like what one user has been
asking for in dependency groups, asked about today on the users list. I
don't believe it is a good idea - taking your Hibernate example, it is
the responsibility here for the hibernate project to declare these
groups responsibly - really, you need to give the client the power to
control what they are getting, if anyone. If Hibernate declares no
groups, the client takes all dependencies, right?

In an ideal world, when a library has optional dependencies, they should
split the optional code out into a separate library. One of maven's aims
is to make building more concise libraries together easily, keeping
clear separation of concerns (though allowing a project to bundle up all
its libraries where it is appropriate for distribution).

I agree this "configuration" is useful when you need to change
dependencies based on JDKs/platform (like JCA in Hibernate, or SWT).
We'd certainly like to add this (it's been on the feature list for both
m1 and m2 a long time), but haven't decided how to declare it yet. Maybe
we could work that out here. Certainly a profile or "configuration"
seems consistent with how we've been planning similar metaphors.

HTH,
Brett


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


Re: maven and ivy

Posted by Brett Porter <br...@apache.org>.
Michal Maczka wrote:

> Group Dependencies (aka composite artifacts)  is the feature which
> enables to define a single dependency on multiple artifacts.
>
> Depenedecny Group is the feature which allows to logically group
> dependencies in poms and for example
> mark some dependencies as optional.
>
> I do believe that the  first feature is actually very useful and not
> at all against maven's philosophy and it
> can eliminate completly the need of having "dependency groups". Simply
> if we take hiberante as example
> hibernate team can publish just one jar and multiple poms - for
> example: hibernate-full.3.0.pom, hibernate-minimal-3.0.pom,
> hibernate-jcs.3.0.pom etc. Those poms will list the dependecies which
> are needed in diffrent cirumstances.
> Of couse jars like hibernate-full.3.0.jar will not exists.

Michal, I'm confused. You seem to be talking about the latter, not the
first one.

I think splitting the pom of an artifact is a very bad idea, especially
if those jars don't exist.

What we've suggested in the past, and I pointed out in my email, was
that a "profile", similar to Ivy's concept of a "configuration" would be
more appropriate. It could be used to split off optional dependencies,
but I wouldn't recommend it - I'd recommend splitting out the code that
used that if it were the case. It's main use would be for getting the
appropriate dependency on a particular platform (JDK, OS, etc).

- Brett

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


Re: maven and ivy

Posted by Brett Porter <br...@apache.org>.
> Unfortunaetly I don't know Maven 2 dependency handling quite well
> enough, but it seems to me that even Maven 2 doesn't go quite far
> enough there. 

Can you give an example of where Maven 2 "doesn't go quite far enough",
other than that we've already discussed?

Maven2's transitive dependencies is not complete. It definitely works -
but I think it was good to keep it simple for the first release, because
nobody has tried this with such a large and varied amount of metadata
(and because most of that metadata is not optimally marked up yet). The
remaining features will be implemented for alpha-3, and are already in
JIRA, and some have been started in code previously.

- Brett



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


Re: maven and ivy

Posted by Colin Sampaleanu <co...@exis.com>.
Michal Maczka wrote:

> Xavier Hanin wrote:
>
>> Hi all,
>>
>> To give a bit more of context on this discussion, the starting point 
>> was brett's blog titled "Ivy: do we really need more metadata?":
>> http://blogs.codehaus.org/people/brett/archives/001023_ivy_do_we_really_need_more_metadata.html 
>>
>>
>> If I still agree that it would be much better to have only one 
>> repository, and one metadata for each project, I'm not sure this is 
>> possible for the moment.
>>
>> I'd be very happy to use poms in ivy, but for the moment the 
>> philosophy is still too different.
>>
>> I've gone a bit deeper in maven doc, and what makes a big difference 
>> between maven and ivy dependency management is that in ivy 
>> dependencies are declared on modules (= a project in maven), whereas 
>> in maven, as far as I understand, dependencies are declared on 
>> artifacts. So it's not so easy to share the same metadata with those 
>> two different approaches. Both have their advantages and drawbacks, 
>> I'm not claiming ivy is better, it's simply different. But in our day 
>> to day use in my company, we appreciate the advantage to have to 
>> declare only one dependency to get all the needed spring-framework 
>> jars and dependencies, and only the one required. And this is made 
>> possible with dependencies on module and the configuration directive. 
>> So I personnaly think it justifies to have our own metadata... and 
>> thus to provide ivyrep, unless you open a gate on ibiblio to publish 
>> our ivy files, in which case we would really be glad to use it.
>
>
> I think that there are two ideas floating around, which have similar 
> names but are quite different:
> group dependencies and dependency groups
>
> Group Dependencies (aka composite artifacts)  is the feature which 
> enables to define a single dependency on multiple artifacts.
>
> Depenedecny Group is the feature which allows to logically group 
> dependencies in poms and for example
> mark some dependencies as optional.
>
> I do believe that the  first feature is actually very useful and not 
> at all against maven's philosophy and it
> can eliminate completly the need of having "dependency groups". Simply 
> if we take hiberante as example
> hibernate team can publish just one jar and multiple poms - for 
> example: hibernate-full.3.0.pom, hibernate-minimal-3.0.pom,
> hibernate-jcs.3.0.pom etc. Those poms will list the dependecies which 
> are needed in diffrent cirumstances.
> Of couse jars like hibernate-full.3.0.jar will not exists.
>
> It is true that in maven you can only declared dependecies on artifacts.
> But those artifacts can be files, which contain metadata which can be 
> expanded to list of artifacts.
> Isn't it something which is already sufficient for ivy?
>
> If I rememebr group dependencies it is something, which was planned 
> since a long time but I don't know if there are still plans to include 
> that feature in m2. IMHO ivy can use poms to implement this feature 
> even if maven won't support this feature.
>
> It can be helpful as we could then define a single dependecy on 
> virtual artifact like "my-web-platform:1.0", which can for example 
> include a web framwork, tag liblaries, logging liblary, ioc container, 
> zip files with css and js files and what ever else which is commonly 
> used for developing web applications inside some company.
>
I've been playing around some with Ivy with the idea of using it for the 
Spring framework builds, until at least such a time as Maven2 might be 
ready and capable. Right now I find the dependency capabilities in Ivy 
very useful. Unfortunaetly I don't know Maven 2 dependency handling 
quite well enough, but it seems to me that even Maven 2 doesn't go quite 
far enough there. To give you an idea of what Ivy can do with 
dependencies, take a look at this view of an Ivy module declaration 
which lists dependencies (this is just a pretty view on an XML file)
  http://www.jayasoft.fr/org/modules/ivy/samples/ivy-sample-xslt.xml
and the documentation for dependency declarations (this page lists all 
the elements, not just dependency stuff)
  http://www.jayasoft.fr/org/modules/ivy/ivyfile.php

In any case, you can see why Ivy had to use an add-on repository 
(ivyrepo) to store extra info (basically the ivyxml files for vairous 
modules) in addition to the data available in the Maven POMs on iBiblio.

Regards,
Colin

-- 
Colin Sampaleanu
Interface21 Principal Consultant
Spring Training, Consulting and Support - "From the Source"
http://www.springframework.com


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


Re: maven and ivy

Posted by Michal Maczka <mm...@interia.pl>.
Xavier Hanin wrote:

> Hi all,
>
> To give a bit more of context on this discussion, the starting point 
> was brett's blog titled "Ivy: do we really need more metadata?":
> http://blogs.codehaus.org/people/brett/archives/001023_ivy_do_we_really_need_more_metadata.html 
>
>
> If I still agree that it would be much better to have only one 
> repository, and one metadata for each project, I'm not sure this is 
> possible for the moment.
>
> I'd be very happy to use poms in ivy, but for the moment the 
> philosophy is still too different.
>
> I've gone a bit deeper in maven doc, and what makes a big difference 
> between maven and ivy dependency management is that in ivy 
> dependencies are declared on modules (= a project in maven), whereas 
> in maven, as far as I understand, dependencies are declared on 
> artifacts. So it's not so easy to share the same metadata with those 
> two different approaches. Both have their advantages and drawbacks, 
> I'm not claiming ivy is better, it's simply different. But in our day 
> to day use in my company, we appreciate the advantage to have to 
> declare only one dependency to get all the needed spring-framework 
> jars and dependencies, and only the one required. And this is made 
> possible with dependencies on module and the configuration directive. 
> So I personnaly think it justifies to have our own metadata... and 
> thus to provide ivyrep, unless you open a gate on ibiblio to publish 
> our ivy files, in which case we would really be glad to use it.

I think that there are two ideas floating around, which have similar 
names but are quite different:
group dependencies and dependency groups

Group Dependencies (aka composite artifacts)  is the feature which 
enables to define a single dependency on multiple artifacts.

Depenedecny Group is the feature which allows to logically group 
dependencies in poms and for example
mark some dependencies as optional.

I do believe that the  first feature is actually very useful and not at 
all against maven's philosophy and it
can eliminate completly the need of having "dependency groups". Simply 
if we take hiberante as example
hibernate team can publish just one jar and multiple poms - for example: 
hibernate-full.3.0.pom, hibernate-minimal-3.0.pom,
hibernate-jcs.3.0.pom etc. Those poms will list the dependecies which 
are needed in diffrent cirumstances.
Of couse jars like hibernate-full.3.0.jar will not exists.

It is true that in maven you can only declared dependecies on artifacts.
But those artifacts can be files, which contain metadata which can be 
expanded to list of artifacts.
Isn't it something which is already sufficient for ivy?

If I rememebr group dependencies it is something, which was planned 
since a long time but I don't know if there are still plans to include 
that feature in m2. IMHO ivy can use poms to implement this feature even 
if maven won't support this feature.

It can be helpful as we could then define a single dependecy on virtual 
artifact like "my-web-platform:1.0", which can for example include a web 
framwork, tag liblaries, logging liblary, ioc container, zip files with 
css and js files and what ever else which is commonly used for 
developing web applications inside some company.

Michal



-------------------------------------------------------------------
Wzmocnij swoja komorke. Najwiekszy z silaczy na tapecie? 
Sprawdz: >> http://link.interia.pl/f1872 <<


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


Re: maven and ivy

Posted by Xavier Hanin <xh...@jayasoft.fr>.
Hi all,

To give a bit more of context on this discussion, the starting point was 
brett's blog titled "Ivy: do we really need more metadata?":
http://blogs.codehaus.org/people/brett/archives/001023_ivy_do_we_really_need_more_metadata.html

If I still agree that it would be much better to have only one 
repository, and one metadata for each project, I'm not sure this is 
possible for the moment.

I'd be very happy to use poms in ivy, but for the moment the philosophy 
is still too different.

I've gone a bit deeper in maven doc, and what makes a big difference 
between maven and ivy dependency management is that in ivy dependencies 
are declared on modules (= a project in maven), whereas in maven, as far 
as I understand, dependencies are declared on artifacts. So it's not so 
easy to share the same metadata with those two different approaches. 
Both have their advantages and drawbacks, I'm not claiming ivy is 
better, it's simply different. But in our day to day use in my company, 
we appreciate the advantage to have to declare only one dependency to 
get all the needed spring-framework jars and dependencies, and only the 
one required. And this is made possible with dependencies on module and 
the configuration directive. So I personnaly think it justifies to have 
our own metadata... and thus to provide ivyrep, unless you open a gate 
on ibiblio to publish our ivy files, in which case we would really be 
glad to use it.

>Ok, they are completely different. This is like what one user has been
>asking for in dependency groups, asked about today on the users list. I
>don't believe it is a good idea - taking your Hibernate example, it is
>the responsibility here for the hibernate project to declare these
>groups responsibly - really, you need to give the client the power to
>control what they are getting, if anyone. If Hibernate declares no
>groups, the client takes all dependencies, right?
>  
>
In this case you can filter out what you don't want, using 
include/exclude features. But that's not the philosophy, so it's much 
better when the component developer as thought about the use that can be 
done of his component. And it's often the case... going back to 
hibernate example, writing the ivy file was only a matter of traduction 
of what is written in hibernate lib README.txt to an ivy file. But once 
more I understand your philosophy, it's just that it doesn't fit our 
needs (and maybe the needs of our users, but they are less numerous than 
yours ! ;-) )

Cheers,
    Xavier

-- 
=========================================================
= Xavier HANIN                    email: xh@jayasoft.fr =
=========================================================
= JAYASOFT                                              =
=                                                       =
= 22, rue Danton                                        =
= 33160 St Médard en Jalles                             =
= France                                                =
= Tél/Fax: +33 (0)5 5753 0080                           =
= http://www.jayasoft.org                               =
========================================================= 


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