You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tomislav Stojcevich <st...@gmail.com> on 2005/10/24 15:30:01 UTC

[m2] Optional Transient Dependecies

If I am correct, maven2 includes all optional transient dependencies by
default and you have to specify an <exclude> for each optional transient
dependency you do not want. This could potentially lead to many excludes.
 It would be nice to have a flag to to turn off all optional transient
dependencies from being included by default for a specific dependency
(something like <excludeOptionalDependencies>) and then specify what you
want included rather than specify what you want excluded. IMO the optional
transient dependencies you want included would be easier to determine
because you usually know what optional dependencies you use, and if you
don't your compile or test cases will tell you.
 --tom

Re: [m2] Optional Transient Dependecies

Posted by Tomislav Stojcevich <st...@gmail.com>.
I think I know how the optional tag works within a pom. I am saying that if
my project has a dependency on projectA and projectA has an optional
dependency for project1 and an optional dependency for project2, that
currently I will get project1 and project2 jars downloaded into my project.
Let's say that I have no use for project2. I know I can specify an excludes
tag in my project so that the project2 dependencies don't get created as
part of the graph (which should work since projectA tagged it as optional).
Simple in this scenerio but what if projectA has optionals for project3, 4,
5, 6, 7 etc... I have to specify each one of those things even though I
could care less about them.
 I think it makes more sense to add a flag to exclude all optionals by
default if we choose to, then manually include only the ones we know we
need.
 In my case I would exclude all optionals from projectA and then only
include project1, rather than excluding project3, project4, project5, etc...
 On 10/24/05, Jason van Zyl <ja...@maven.org> wrote:
>
> On Mon, 2005-10-24 at 09:30 -0400, Tomislav Stojcevich wrote:
> > If I am correct, maven2 includes all optional transient dependencies by
> > default and you have to specify an <exclude> for each optional transient
> > dependency you do not want. This could potentially lead to many
> excludes.
>
> A project itself can also specify an <optional/> element for a
> dependency which means that the transitive dependencies for that
> dependency will not be included in the graph. But this is up to the
> project distributing the POM.

 > It would be nice to have a flag to to turn off all optional transient
> dependencies from being included by default for a specific dependency
> (something like <excludeOptionalDependencies>) and then specify what you
> want included rather than specify what you want excluded. IMO the optional
> transient dependencies you want included would be easier to determine
> because you usually know what optional dependencies you use, and if you
> don't your compile or test cases will tell you.

This feature exists but the project where the POM originates must
specify a dependency as optional. I created a JIRA issue so that this
notion gets documented.

> --tom
--
jvz.

Jason van Zyl
jason at maven.org <http://maven.org>
http://maven.apache.org



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




--
--tom

Re: [m2] Optional Transient Dependecies

Posted by Jason van Zyl <ja...@maven.org>.
On Mon, 2005-10-24 at 09:30 -0400, Tomislav Stojcevich wrote:
> If I am correct, maven2 includes all optional transient dependencies by
> default and you have to specify an <exclude> for each optional transient
> dependency you do not want. This could potentially lead to many excludes.

A project itself can also specify an <optional/> element for a
dependency which means that the transitive dependencies for that
dependency will not be included in the graph. But this is up to the
project distributing the POM.

>  It would be nice to have a flag to to turn off all optional transient
> dependencies from being included by default for a specific dependency
> (something like <excludeOptionalDependencies>) and then specify what you
> want included rather than specify what you want excluded. IMO the optional
> transient dependencies you want included would be easier to determine
> because you usually know what optional dependencies you use, and if you
> don't your compile or test cases will tell you.

This feature exists but the project where the POM originates must
specify a dependency as optional. I created a JIRA issue so that this
notion gets documented.

>  --tom
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



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


Re: [m2] Optional Transient Dependecies

Posted by Eduardo Rocha <ed...@gmail.com>.
Nice idea.

2005/10/24, Tomislav Stojcevich <st...@gmail.com>:
>
> If I am correct, maven2 includes all optional transient dependencies by
> default and you have to specify an <exclude> for each optional transient
> dependency you do not want. This could potentially lead to many excludes.
> It would be nice to have a flag to to turn off all optional transient
> dependencies from being included by default for a specific dependency
> (something like <excludeOptionalDependencies>) and then specify what you
> want included rather than specify what you want excluded. IMO the optional
> transient dependencies you want included would be easier to determine
> because you usually know what optional dependencies you use, and if you
> don't your compile or test cases will tell you.
> --tom
>
>