Hi devs,
Running mvn dependency:dependency-analyze produces interesting results.
For example:
[INFO]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[INFO] Building XWiki Commons - Properties 3.2-SNAPSHOT
[INFO]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
…
[INFO] --- maven-dependency-plugin:2.3:analyze (default-cli) @ xwiki-commons-properties
---
[WARNING] Used undeclared dependencies found:
[WARNING] org.slf4j:slf4j-api:jar:1.6.1:compile
[WARNING] javax.inject:javax.inject:jar:1:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.xwiki.commons:xwiki-commons-component-api:jar:3.2-SNAPSHOT:compile
[WARNING] org.xwiki.commons:xwiki-commons-test:jar:3.2-SNAPSHOT:test
[WARNING] org.hibernate:hibernate-validator:jar:4.2.0.Final:test
[WARNING] org.hamcrest:hamcrest-core:jar:1.1:test
[WARNING] org.jmock:jmock:jar:2.5.1:test
The question is (for this module but more generally for all others):
* Should we add slf4j and javax.inject reps in the pom.xml for this module? (for ex today
slf4j and javax.inject are found in the component-api dep)
I think we should, wdyt?
Note that the "Unused declared dependencies found:" doesn't always generate
correct results as is the case here. This is mostly because it's a static byte code
check so any dep used at runtime will be considered unused.
See
http://www.sonatype.com/books/mvnex-book/reference/optimizing-sect-dependen…
Thanks
-Vincent