Yes. First, you can specify exclusions to exclude certain transitive
dependencies from being used. For instance, I depend on
spring-hibernate, but I only use the net.sf.hibernate (hibernate 2)
features, so I don't need Hibernate 3 stuff:
<dependency>
<groupId>springframework</groupId>
<artifactId>spring-hibernate</artifactId>
<version>1.2.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
artifactId>hibernate</artifactId>
</exclusion>
</exclusions>
</dependency>
Secondly, the project you depend on could make some of their
dependencies optional so that you don't have to manually exclude them.
As time goes by, more of the pom's in the central repository will get
<optional>true</optional> set on the correct dependencies.
-Stephen
On 10/21/05, Mark Kuzmycz <[EMAIL PROTECTED]> wrote:
> Transitive dependencies are very useful as it enable you to specify the
> direct dependencies for the project and maven handles the dependencies
> of the dependencies and so on. However, if the product of a project is a
> war or ear then this can lead to an increased artifact size due to the
> transient dependencies.
>
> For example, if you include jelly or dom4j as a dependency the both of
> these have a number of dependencies that are optional. That is, they are
> only required if you are using certain functionality (or in the case of
> jelly tags). This can lead to the inclusion of dependencies that are not
> needed by the project.
>
> My question is, how do I control the transient dependencies so that the
> dependencies that are not required the project are not added to the war
> or ear file? Is there a better way than specifying all of the
> dependencies and marking their scope as test?
>
> Regards,
> Mark.
>
>
> _______________
> Siebel
> IT'S ALL ABOUT THE CUSTOMER
> Visit www.siebel.com
>
> This e-mail message is for the sole use of the intended recipient(s) and
> contains confidential and/or privileged information belonging to Siebel
> Systems, Inc. or its customers or partners. Any unauthorized review, use,
> copying, disclosure or distribution of this message is strictly prohibited.
> If you are not an intended recipient of this message, please contact the
> sender by reply e-mail and destroy all soft and hard copies of the message
> and any attachments. Thank you for your cooperation.
>
>
--
Stephen Duncan Jr
www.stephenduncanjr.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]