On Dec 25, 2007 5:06 PM, aldana <[EMAIL PROTECTED]> wrote:
>
> in my point of view the automatic inclusion of transitive dependencies
> should be avoided and directly used libraries should be included explicitly.
> this makes maintenance in view of dependencies more feasible:
> -so project B must include library x explicitly to use x's features, i.e.
> transitive dependencies surely must be provided at runtime but should not be
> visible for compile-time.

Unfortunately, this does not work. There are situations where the
transitive dependencies
are needed even during compile time (e.g. B uses a class from A that
inherits from something in x).

>
> when we switched to maven2 we enforced this through marking all dependencies
> as optional. this made dependencies of project A invisible for project B so
> project B was enforced to include all directly used libraries to. having
> read http://maven.apache.org/pom.html and explanation for optional flag
> tells me that i misused optional:
> "In the shortest terms, optional  lets other projects know that, when you
> use this project, you do not require this dependency in order to work
> correctly."
> what i think a bit confusing is the snippet (you do not require this
> dependency in order to work correctly.), why should i then include this
> dependency at all, if i do not need it...?

The module with the optional dependency could check at runtime if it
is available in the class path and only use it if it can be found.

- Henry

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

Reply via email to