Hello all,

I have a simple requirement: I would like to determine very fast if my
multi-module project has any SNAPSHOT dependency.

First try was with the /mvn dependency:tree / command and grepping for the
word SNAPSHOT. But the dependency plugin seems to use the repository
dependencies, so it is not able to resolve inter-module dependencies without
first having to INSTALL the dependencies.

A workaround is to use:
/mvn compile dependency:tree -Dmaven.main.skip=true/
It seems this command initializes enough of the build plan so that Maven is
able to resolve internal (inter-modules) dependencies. The
"/maven.main.skip/" is used to optimize the speed by skipping the actual
compilation. In my case I had to also add a /-DskipSourceGeneration=true/
because a source generation step was relying on the source being compiled.

I also tried with the enforcer plugin which now allows rules to be passed on
the command line. But the result is the same, the build plan seems not to be
build hence dependency resolution is done through the repository and fails
if all jars are not INSTALLED first. As previously the workaround is to
force a fake "compile" step:

/mvn clean compile
org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce
-Drules=requireReleaseDeps -Dmaven.main.skip=true
-DskipSourceGeneration=true/

So the question is: is there really no way to have the full dependency graph
without all those hacks ?



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to