Given the number of projects in Cocoon I'm sure it is.

Just for grins run mvn -P allblocks dependency:analyze. It will take a while but has tons of useful output.

As an example, I've shown part of it below. You can see that commons-logging 1.1 is used as a transitive dependency for XML while commons-logging 1.0.4 is used as a transitive dependency for the Pipeline components. While it may not happen for commons-logging, in other cases when packaged up into a single webapp a runtime exception might likely occur. If commons-logging was placed in the dependencyManagement of the root pom than only that version would get used and presumably, if there is a problem, it would get detected during the build.

Also notice that the Pipeline components below declares that it needs cocoon-configuration-api but doesn't actually use it.

I'm sure that some really smart person could figure out how to write a perl script and take the output below or the output from mvn dependency:resolve and get it to generate all the dependencies.

[INFO] Building Cocoon XML Implementation
[INFO]    task-segment: [dependency:analyze]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing dependency:analyze
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [dependency:analyze]
[INFO] Used declared dependencies:
[INFO]    xml-apis:xml-apis:jar:1.3.02:compile
[INFO]    xml-resolver:xml-resolver:jar:1.2:compile
[INFO]    org.springframework:spring-context:jar:2.0.3:compile
[INFO]    org.apache.cocoon:cocoon-xml-api:jar:1.0.0-RC1-SNAPSHOT:compile
[INFO] Used undeclared dependencies:
[WARNING]    commons-logging:commons-logging:jar:1.1:compile
[WARNING]    org.springframework:spring-beans:jar:2.0.3:compile
[WARNING]    org.springframework:spring-core:jar:2.0.3:compile
[INFO] Unused declared dependencies:
[INFO]    None
[WARNING] Potential problems discovered.
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO]    Nothing in DepMgt.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Cocoon Pipeline Components
[INFO]    task-segment: [dependency:analyze]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing dependency:analyze
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [dependency:analyze]
[INFO] Used declared dependencies:
[INFO]    javax.servlet:servlet-api:jar:2.4:provided
[INFO] org.apache.cocoon:cocoon-pipeline-impl:jar:1.0.0-RC1-SNAPSHOT:compile
[INFO]    org.apache.cocoon:cocoon-xml-api:jar:1.0.0-RC1-SNAPSHOT:compile
[INFO]    org.apache.cocoon:cocoon-util:jar:1.0.0-RC1-SNAPSHOT:compile
[INFO] Used undeclared dependencies:
[WARNING] org.apache.excalibur.components:excalibur-pool-api:jar:2.2.1:compile
[WARNING]    xml-apis:xml-apis:jar:1.3.02:compile
[WARNING]    commons-lang:commons-lang:jar:2.3:compile
[WARNING] org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile [WARNING] org.apache.excalibur.components:excalibur-xmlutil:jar:2.2.1:compile
[WARNING]    jakarta-regexp:jakarta-regexp:jar:1.4:compile
[WARNING]    commons-logging:commons-logging:jar:1.0.4:compile
[WARNING] org.apache.excalibur.components:excalibur-store:jar:2.2.1:compile [WARNING] org.apache.excalibur.components:excalibur-sourceresolve:jar:2.2.1:compile [WARNING] org.apache.cocoon:cocoon-pipeline-api:jar:1.0.0-RC1-SNAPSHOT:compile
[INFO] Unused declared dependencies:
[INFO]    org.apache.cocoon:cocoon-configuration-api:jar:1.0.0:compile
[WARNING] Potential problems discovered.
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO]    Nothing in DepMgt.

Reinhard Poetz wrote:
Ralph Goers wrote:
Get rid of the versions in all the poms. Create a dependencyManagement section in the root pom. Add all Cocoon dependencies to the dependencyManagement section and specify the version there.

Could this be automatized? Doing this by hand sounds like an awful lot of work to me ...

Reply via email to