I need to get the “dependency:tree” goal output from Maven at the start of the “test” phase, to help debug an issue for which I need to know what versions of everything are being used.
In Ant it would have been easy, I’ve looked through the Maven docs and numerous answers on here but still can’t figure it out, surely it’s not that hard?
If you want to be sure that the
dependency:treeis being run in the beginning of thetestphase then you will have to move the originalsurefire:testgoal to being conducted after thedependency:tree. To do that you will have to put the plugins in the order that they should be run.Here is a complete
pom.xmlexample that adds themaven-dependency-pluginbefore themaven-surefire-plugin. The originaldefault-testis disabled and a newcustom-testis added and this one will be run after thedependency-treeexecution.It’s a little bit awkward but that is the way to disable executions.