Locked History Actions

Diff for "ivy/Manual/m2comparison"

Differences between revisions 3 and 4
Deletions are marked like this. Additions are marked like this.
Line 27: Line 27:
それぞれのコンフィギュレーションでは必要なアーティファクト(jar, war, ...)が宣言されている。
そして、それぞれのコンフィギュレーションでは他のモジュールへの依存を宣言し、どの依存コンフィギュレーションが必要であるかを宣言する。これをコンフィギュレーションマッピングといい、我々がソフトウェア開発においてしばしば直面するたくさんの問題に答える非常にフレキシブルな方法なのである。

Maven2は、スコープと呼ばれるものを持っており、
テストスコープ、ビルドタイムスコープの一部として依存を宣言することができる。
これらのスコープに依存することで、依存アーティファクト(Maven2では一つのモジュールにただ一つのアーティファクト)を得ることができる。スコープはMaven2ではあらかじめ定義されており、変更することはできない。
oracleスコープを定義することはできないし、
No way to indicate you need what has been declared to be needed in the runtime scope of your dependency in your compile one.
すべては大理石の中に記述されている。

そしてこれが問題の発端となる。Matt RaibleがMaven2の依存についてブログに記述したように。

多くのライブラリのための非常に多くの不必要な依存がダウンロードされてしまいます。
例えば、Hibernateは一群のJBoss Jarファイルをダウンロードするし、Display Tagは様々なWebフレームワークのJarをダウンロードします。私自身が追加した多くの依存のほとんどを削除していました。
Line 29: Line 43:
But you can also have a mysql and an oracle configuration. Or an hibernate and a jdbc configuration. In each configuration you can declare what artifacts (jar, war, ...) are required. And in each configuration, you can declare your dependencies on other modules, and describe which configuration of the dependency you need. This is called configuration mapping, and it is a very flexible way to answer to a lot of problems we face very often in software development. Hibernateでは様々なキャッシュ実装、様々なコネクションプール実装が用いられる可能性のあることが問題で、
これはスコープでは管理できない。
しかるに、Ivyコンフィギュレーションでは、この種の問題に対するエレガントな解決を提供する。
例えば、こnケースでは、hibernateをIvyファイルとして扱い、依存性を次のように宣言すればよい。
Line 31: Line 48:
Maven2 on its side has something called the scope. You can declare a dependency as being part of the test scope, or the buildtime scope. Then depending on this scope you will get the dependency artifact (only one artifact per module in maven2) with its dependencies depending on their scope. Scopes are predefined in maven2 and you can't change that. No way to create an oracle scope. No way to indicate you need what has been declared to be needed in the runtime scope of your dependency in your compile one. Everything here is written in the marble. {{{
<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->proxool,oscache"/>
}}}
これはproxoolとoscache実装と共にhibernateを得る場合である。
{{{
<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->dbcp,swarmcache"/>
}}}
上はdhcpとswarmcacheを得る場合である。
Line 33: Line 57:
And this leads to some kind of troubles... as Matt Raible stated in his blog talking about maven2 dependencies: == ドキュメント ==
Line 35: Line 59:
    There are a *lot* of unnecessary dependencies downloaded for many libraries. For example, Hibernate downloads a bunch of JBoss JARs and the Display Tag downloads all the various web framework JARs. I found myself excluding almost as many dependencies as I added. ツールを使う場合の重要な点はドキュメンテーションの量である。
Ivyでは、それらがブロークンイングリッシュで書かれている場合であっても、リファレンスドキュメントは広い範囲ですべての機能を網羅している、たくさんの例と共に。
そしてまた、我々は、Ivyの新バージョンのたびにメンテナンスされるいくつかのオフィシャルなチュートリアルを提供している。
我々はドキュメントを重視しているため、Ivy 2.0.0-alpha2からはオンラインバージョンも提供している。
Line 37: Line 64:
The problem is that hibernate can be used with several cache implementations, several connection pool implementation, ... And this can't be managed with scopes, wheres Ivy configurations offers an elegant solution to this kind of problem. For instance, in ivy, assuming hibernate as an ivy file like this one, then you can declare a dependency like that:

<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->proxool,oscache"/>

to get hibernate with its proxool and oscache implemetations, and like that:

<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->dbcp,swarmcache"/>

to get hibernate with dbcp and swarmcache.

Documentation
An important thing to be able to use a tool is its amount of documentation. With Ivy, even if they are written in broken english (would you have preferred well written french :-)), the reference documentation is extensive and covers all the features including many examples. We also provide some official tutorials which are maintained with the new versions of Ivy. And since we consider documentation so important, we also provide online versions of documentation per Ivy version since Ivy 2.0.0-alpha2.
Line 52: Line 67:
Conflict management == Conflict management ==
Line 57: Line 72:
Flexibility == Flexibility ==
Line 62: Line 77:
Public Repositories == Public Repositories ==

IvyとMaven2の比較

Maven2と比較してどうなの?とは度々聞かれることである。ここに我々の意見を述べておこう。

ただ、明らかにこの手の比較はバイアスされる(ここはIvyのサイトだよ)けれども、できる限りフェアにいこう。 このページに何か抜けがあったり間違いがあったりしたら知らせてほしい。 またcodehausのMaven2機能比較ページを見てもよいだろう。これは別の視点を与えてくれる。

さらに、この話にはさまざまなディスカッションがなされている。その中でも among which the one triggered by spring contemplating about switching to maven is may be the more interesting.

しかしここでは、Maven2とIvyの大きな違いと思うところを指摘しよう。

木とリンゴを比較する

まず最初に、もっとも重要な違いというのは、それらが同じ種類のツールではないということだ。 Maven2はソフトウェアプロジェクト管理と統合化初ツールであるのに対し、Ivyは依存関係管理ツールであり、それはもっともポピュラーなビルド管理ツールであるAntと高度に統合されている。 したがって、もう少し面白い比較というのは、Ant+IvyとMaven2になるかと思うが、これはこのページの範囲を大きく超えてしまう。 ここでは依存関係管理にだけ集中しよう。

異なるコンセプト

Ivyはコンフィギュレーションという一つの概念に大きく依拠している。 Ivyにおいては、モジュールコンフィギュレーションというおのが、モジュールを使ったり見たりするための方法である 例えば、あなたのモジュールに、テスト時とランタイム時のコンフィギュレーションがあるとする。 しかしまた、mysqlとoracleのコンフィギュレーションも持つとする。 はたまたhibernatetjdbcのコンフィギュレーションも。 それぞれのコンフィギュレーションでは必要なアーティファクト(jar, war, ...)が宣言されている。 そして、それぞれのコンフィギュレーションでは他のモジュールへの依存を宣言し、どの依存コンフィギュレーションが必要であるかを宣言する。これをコンフィギュレーションマッピングといい、我々がソフトウェア開発においてしばしば直面するたくさんの問題に答える非常にフレキシブルな方法なのである。

Maven2は、スコープと呼ばれるものを持っており、 テストスコープ、ビルドタイムスコープの一部として依存を宣言することができる。 これらのスコープに依存することで、依存アーティファクト(Maven2では一つのモジュールにただ一つのアーティファクト)を得ることができる。スコープはMaven2ではあらかじめ定義されており、変更することはできない。 oracleスコープを定義することはできないし、 No way to indicate you need what has been declared to be needed in the runtime scope of your dependency in your compile one. すべては大理石の中に記述されている。

そしてこれが問題の発端となる。Matt RaibleがMaven2の依存についてブログに記述したように。

多くのライブラリのための非常に多くの不必要な依存がダウンロードされてしまいます。 例えば、Hibernateは一群のJBoss Jarファイルをダウンロードするし、Display Tagは様々なWebフレームワークのJarをダウンロードします。私自身が追加した多くの依存のほとんどを削除していました。

Hibernateでは様々なキャッシュ実装、様々なコネクションプール実装が用いられる可能性のあることが問題で、 これはスコープでは管理できない。 しかるに、Ivyコンフィギュレーションでは、この種の問題に対するエレガントな解決を提供する。 例えば、こnケースでは、hibernateをIvyファイルとして扱い、依存性を次のように宣言すればよい。

<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->proxool,oscache"/>

これはproxoolとoscache実装と共にhibernateを得る場合である。

<dependency org="hibernate" name="hibernate" rev="2.1.8" conf="default->dbcp,swarmcache"/>

上はdhcpとswarmcacheを得る場合である。

ドキュメント

ツールを使う場合の重要な点はドキュメンテーションの量である。 Ivyでは、それらがブロークンイングリッシュで書かれている場合であっても、リファレンスドキュメントは広い範囲ですべての機能を網羅している、たくさんの例と共に。 そしてまた、我々は、Ivyの新バージョンのたびにメンテナンスされるいくつかのオフィシャルなチュートリアルを提供している。 我々はドキュメントを重視しているため、Ivy 2.0.0-alpha2からはオンラインバージョンも提供している。

With maven2, it's a bit difficult to clearly know what can be considered as dependency management documentation, but we didn't managed to find much: some small introductory guides, short entries in the pom reference guide, and not really much more. Even in the maven book you can get for free on mergere website, the insight about dependency management is still light in our point of view.

Conflict management

Conflict management are an important part of dependency management, cause when dealing with transitive dependencies you often have to face conflicts. In this area, Ivy let you do whatever you want: use one conflict manager in one module, another one elsewhere, decide which revision you will get, ... You can even plug your own conflict manager if you need to.

With maven2, conflict management is quite simple: the principle is to get the nearest definition. So if your module depends on foo 1.0, none of your dependencies will ever manage to get foo 1.1 without a change in your own dependency declaration. It may be ok in some cases, it may not in others...

Flexibility

In Ivy many things can be configured, and many others can be plugged in: dependency resolvers, conflict manager, module descriptor parser, latest revision strategy, ...

Maven2 also offers repository pluggability, but not much more as far as we know. Moreover, repository configuration is much less flexible than with Ivy: no repository chaining, no way to split metadata and artifacts in multiple repositories, ...

Public Repositories

Maven2 comes out of the box configured to use maven2 repository, which contains a lot of modules (both artifacts and module descriptors). The only problem some may face is that module descriptors are not always checked, so some are not really well written. Ivy being compatible with maven 2 metadata, the default public repository used is also the maven 2 repository, which is fine for a good out of the box experience.

However, we don't recommend to use such a public repository for an enterprise build system, and as such Ivy provides features and documentation to build your own enterprise repository based (or not) on data available in the public repository.