maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manfred Moser" <manf...@mosabuam.com>
Subject Re: Why is "mvn validate compile" different from "mvn validate; mvn compile"?
Date Thu, 07 Nov 2013 17:04:50 GMT
You should not use either call. The validate phase is automatically run
before the compile phase as part of the default lifecycle

Just use

mvn compile

In general it does not make sense to call multiple phases of the same
lifecycle since each phase invocation will run all phases up to and
including the phase mentioned.

manfred

 > Hi.
>
> I have used mvn for a while, but am by no means an expert, so if I am
> asking an obvious question please pardon me and answer it anyway if you
> can. Thanks.
>
> I have bound some plugin executions to the validate phase because I need
> them to happen before compile. If I execute
>
>     mvn validate
>     mvn compile
>
> everything is fine. But if I call
>
>     mvn validate compile
>
> Maven behaves differently. What I do during validate is download external,
> non-mavenised (as in unavailable on Central) dependencies and install them
> locally if they are not registered in my local repo yet. Those
> dependencies are used in the compile phase. Now if I seperate the two
> calls it works, but if I do it in one mvn call and rely on the order of
> phases, Maven breaks my build by checking for remote and local artifact
> availability *before* actually starting the validate stuff from my POM. If
> I run "mvn -X ..." I can clearly see the difference.
>
> Am I doing anything wrong? Can I force Maven to actually do what is
> described in the documentation, i.e. perform the whole validate phase with
> all executions bound to it in my POM *before* doing anything else related
> to the compile phase such as trying to download dependencies?
>
> Thank you
> --
> Alexander Kriegisch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Mime
View raw message