maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Douglass <douglass.d...@gmail.com>
Subject Re: Why is "mvn validate compile" different from "mvn validate; mvn compile"?
Date Thu, 07 Nov 2013 20:23:22 GMT
On Thu, Nov 7, 2013 at 12:41 PM, Alexander Kriegisch <
Alexander@kriegisch.name> wrote:

> 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.
>
>
You're right, I didn't answer your original question. The different is
because "mvn validate compile" and/or "mvn compile" is a single invocation
of maven and dependencies are resolved once (by default, w/o any other
plugins/configuration). "mvn validate; mvn compile" are 2 separate
invocations of maven; the first one does your "download external,
non-mavenised" business, which makes those dependencies available for the
second.

I still suggest you read Steven's post as you're question/problem indicates
you're heading down the not-uncommon path of trying to script your build
(like we all did in the Ant days) vs. giving into The Maven Way. There's
lots of similar conversations in the list archives, the blog post is the
result of many such "debates". I'll apologize in advance if this is not
your case.

Cheers,
Doug

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message