Only "mvn compile" yields the exact same result as "mvn validate compile", I 
just did it like this explicitly to make a point and show clearly what hapens. 
So again: Why, pray tell, does my two-phase build work if first I only do "mvn 
validate" and then "mvn compile", but not with only "mvn compile"? The question 
is still unanswered. Two people told me I made a mistake but did not explain 
which one and where the different behaviour comes from.

If it helps I can send logs of "mvn -X ..." when I am back in office so you can 
see the difference if my explanation is not good enough. I thought it was. :-(



> Am 07.11.2013 um 18:04 schrieb "Manfred Moser" <[email protected]>:
> 
> 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: [email protected]
>> For additional commands, e-mail: [email protected]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to