From time to time it becomes advisable to run an analysis over the pom files to ensure that each sub-projects dependencies are listed and that any needless dependencies are removed. Maven provides a tool to help with this, but it needs to be treated with circumspection.
Run dependency analysis from the parent directory using the command 'mvn dependency:analyze'. The key part of the log will look like this
[WARNING] Used undeclared dependencies found: [WARNING] org.opensaml:opensaml-profile-api:jar:3.0-SNAPSHOT:compile [WARNING] com.google.guava:guava:jar:14.0.1:compile [WARNING] joda-time:joda-time:jar:2.2:compile [WARNING] Unused declared dependencies found: [WARNING] net.shibboleth.idp:idp-profile-api:jar:3.0-SNAPSHOT:compile [WARNING] org.springframework.webflow:spring-webflow:jar:2.3.2.RELEASE:compile [WARNING] org.glassfish:javax.json:jar:1.0.2:runtime [WARNING] org.codehaus.janino:janino:jar:2.6.1:compile [WARNING] ch.qos.logback:logback-classic:jar:1.0.11:compile [WARNING] ch.qos.logback:logback-core:jar:1.0.11:compile [WARNING] javax.mail:mail:jar:1.4.7:compile [WARNING] org.springframework:spring-context-support:jar:3.2.2.RELEASE:compile [WARNING] javax.servlet:servlet-api:jar:2.5:provided [WARNING] org.springframework:spring-test:jar:3.2.2.RELEASE:test [WARNING] net.shibboleth.utilities:java-support:test-jar:tests:2.0-SNAPSHOT:test [WARNING] org.slf4j:jcl-over-slf4j:jar:1.7.5:compile [WARNING] org.slf4j:jul-to-slf4j:jar:1.7.5:compile [WARNING] org.slf4j:log4j-over-slf4j:jar:1.7.5:compile [WARNING] xmlunit:xmlunit:jar:1.4:test |
Project supplied, versioned dependencies
<dependency> <groupId>${project.groupId}</groupId> <artifactId>idp-authn-api</artifactId> <version>${project.version}</version> </dependency> |
Project supplied, unversioned dependencies:
<dependency> <groupId>net.shibboleth.ext</groupId> <artifactId>spring-extensions</artifactId> </dependency> |
Unversions, non-project dependencies:
<dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> </dependency> |