You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James Adams <mo...@gmail.com> on 2007/10/17 20:14:38 UTC
How can I determine which dependencies are essential?
I have a few dependencies in my pom.xml which pull in many transitive
dependencies, and this results in a huge war artifact. I want to pare down
the dependencies using exclusions in order that the resulting war will
contain only the jars that it really needs, but my problem is that I don't
know how to go about figuring out which dependencies are necessary and which
ones can be excluded. Is there a good way to do this other than trial and
error?
Thanks in advance for any suggestions.
--James
--
View this message in context: http://www.nabble.com/How-can-I-determine-which-dependencies-are-essential--tf4642363s177.html#a13259688
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How can I determine which dependencies are essential?
Posted by Mark Hobson <ma...@gmail.com>.
On 17/10/2007, James Adams <mo...@gmail.com> wrote:
> I have a few dependencies in my pom.xml which pull in many transitive
> dependencies, and this results in a huge war artifact. I want to pare down
> the dependencies using exclusions in order that the resulting war will
> contain only the jars that it really needs, but my problem is that I don't
> know how to go about figuring out which dependencies are necessary and which
> ones can be excluded. Is there a good way to do this other than trial and
> error?
>
> Thanks in advance for any suggestions.
You can use dependency:analyze to determine which direct project
dependencies are actually required to compile, although it won't
currently tell you which transitive dependencies you can exclude.
See:
http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How can I determine which dependencies are essential?
Posted by Farrukh Najmi <fa...@wellfleetsoftware.com>.
James Adams wrote:
> I have a few dependencies in my pom.xml which pull in many transitive
> dependencies, and this results in a huge war artifact. I want to pare down
> the dependencies using exclusions in order that the resulting war will
> contain only the jars that it really needs, but my problem is that I don't
> know how to go about figuring out which dependencies are necessary and which
> ones can be excluded. Is there a good way to do this other than trial and
> error?
>
> Thanks in advance for any suggestions.
>
There are no silver bullets AFAIK. One hopes that each of your project's
dependencies declare their own dependencies carefully and properly
scoped (e.g. compile, test).
A jar dependency analyzer tool like:
<http://www.jfrog.org/sites/dep-analyzer/1.0/>
may be helpful to understand dependencies both direct and indirect.
Best of luck and do share if you find any good solutions to this common
problem.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org