AFAIK, this shows the dependencies from which your code is using classes, but 
which are not declared in your pom file, but by another dependency. 

ie.

You -> Project A -> Project B

And one of your classes imports something from Project B. This will compile.

Project A releases a new versions, which is not dependend anymore on Project B.

You update the version of Project A to the new version, et voila, your code is 
not compiling anymore.

It is better to declare all your dependencies your project uses, even if there 
are already included in one of your dependencies.

Hth,

Nick Stolwijk


-----Original Message-----
From: Wim Deblauwe [mailto:[EMAIL PROTECTED]
Sent: Wed 11/21/2007 4:32 PM
To: Maven Users List
Subject: [dependency plugin] Used undeclared dependencies
 
Why does the dependency plugin gives "Used undeclared dependencies"? What is
the reason or how does maven know this?

I looked at the docs (
http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html),
but it did not give much info on why you get this and what you can do about
it.

This is the output:
[INFO] [dependency:analyze]
[INFO] Used declared dependencies:
[INFO]    net.java.dev.glazedlists:glazedlists_java15:jar:1.7.0:compile
[INFO]    net.java.dev.timingframework:timingframework:jar:1.0:compile
[INFO]    com.jidesoft:jide-oss:jar:2.1.3.04:compile
[INFO]    log4j:log4j:jar:1.2.14:compile
[INFO]    org.swinglabs:swing-worker:jar:1.1:compile
[INFO]    com.jgoodies:looks:jar:2.1.2:compile
[INFO]    com.thoughtworks.xstream:xstream:jar:1.2.1:compile
[INFO]    org.swinglabs:swingx:jar:0.9:compile
[INFO]    org.testng:testng:jar:jdk15:5.1:test
[INFO] Used undeclared dependencies:
[WARNING]    com.jhlabs:filters:jar:2.0.235:compile
[INFO] Unused declared dependencies:
[INFO]    None
[WARNING] Potential problems discovered.
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO]    Nothing in DepMgt.

Additionally, the docs show a target called "dependency:tree" but this does
not seem to work.

regards,

Wim

-- 
Vigilog - an open source log file viewer: http://vigilog.sourceforge.net
Blog: http://www.jroller.com/page/Fester

Reply via email to