-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


I had the same question some days back
(https://mail-archives.apache.org/mod_mbox/maven-users/202009.mbox/%3C922b4efc-3296-d35d-0675-d6c0090cc4b1%40swe-blog.net%3E)
and Stuart McCulloch sent me a link to this JIRA issue:
https://issues.apache.org/jira/browse/MNG-4979

So, this seems to be a recurring issue that irritates a lot of people.

Oliver

Am 14.09.20 um 18:11 schrieb Andreas Sewe:
> Hi,
>
> I am currently sprinkling <configuration> child elements like the
> following through my (parent) POMs for enforcer:enforce, tidy:check and
> checkstyle:check <executions>:
>
>   <skip>${skipChecks}</skip>
>
> This allows me to skip all kinds of checks with a simple
> -DskipChecks=true (or even -DskipChecks), just like I am used to for
> tests with -DskipTests.
>
> Unfortunately, I cannot selectively override this, as the following
> doesn't work:
>
>   mvn install -DskipChecks -Denforcer.skip=false
>
> The above command still uses the <skip>${skipChecks}</skip> (with
> skipChecks=true).
>
> Further experimentation led me to believe that *any* explicit pom.xml
> <configuration> cannot be overridden by a property expression given on
> the command line.
>
> This was very surprising, as I would have expected Maven to follow a
> "command line takes precedence over configuration file" approach like
> other tools -- but apparently it doesn't (at least in Maven 3.3.9 and
> 3.6.3) and thus violates the Principle of Least Astonishment (for one of
> its users anyway).
>
> In particular, Maven's handling of property expressions means that
> having no <skip> element and making the default explicit behave
> differently; a <configuration> element like this can never be overridden
> on the command-line:
>
>   <skip>false</skip>
>
> I wonder why it was designed that way?
>
> Or should this be considered a bug?
>
> Best wishes,
>
> Andreas
>
- -- 
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E [email protected]
S oliver.b.fischer
J [email protected]
X http://xing.to/obf
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEU7j685HGR9cAsMGwB88X6wLziPwFAl9fzxAACgkQB88X6wLz
iPzd/w/9FFSjkXtHrspdg9z8sV5tXEEXIGJdw1XRcDL8SDl412GmCIoCN5+HuYSa
MIMyGrmlsMgdeHUkx/0wvUXLBjmV7oEiAIhiLhA4l25F3Qc+y5zoUxZIUjNbZiZu
4oR04RZcrIdBA67sdxkvhQfM8rnv4/P97L70CVZpA8/nFNDjYWrG2troCTLMn6MI
NmjiYMpmG9xHDxy3KkqJqXwfEZDmEqphYV2K4T18EOcw5dP7ZJBK3sHXczK93Wkz
eTrDDgVcBHexSR2aqGX6xlNdtR4UScsCJjsXpnCZq/09qS9pOduBCIPX8Cswsi7B
d1nFKmNR41TpZtQFv8LCrbNkK5FBSupsxrOGgKjGza70y3JPki13I15tKZjnMZFY
CvaSK36VzEQOMVaZL5TB1ybXvF9OWXJgwqGT1dYCoCm3WDFCdGka3igVKKJWEE/P
xriYNkmzhKuKY5mAJa7wpXa1DQLnraFLcIPTEHNKLYocct58yRGtsgCvx7FIXflY
rtfou8+b5Q6FGHJcGpTiL7Zh191nV1gUJJA3ZXJwGzdvs+tvwLYPj34+5LNvwj0z
Ax1MKZLllCfq2wLm8NAnVqHYh55K5YN5O/jG+Fk9Mw87ynj+Tn9qIQ9jQ7nGIVyv
nvF87+KgBTQE5OFSpmLvDJEkN+zPqnp81VDkjNdMUSj16kcgAw8=
=oPqj
-----END PGP SIGNATURE-----


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

Reply via email to