Re: Why does POM have precedence over -D property expressions?

2020-09-16 Thread Bernd Eckenfels
@maven.apache.org Betreff: Re: Why does POM have precedence over -D property expressions? Andy Feldman wrote: >> My situation is unfortunately a bit more complex than that, as I have >> *two* s of the maven-enforcer-plugin, only one of which >> should be affected by -DskipChecks. The

Re: Why does POM have precedence over -D property expressions?

2020-09-16 Thread Andreas Sewe
Andy Feldman wrote: >> My situation is unfortunately a bit more complex than that, as I have >> *two* s of the maven-enforcer-plugin, only one of which >> should be affected by -DskipChecks. The other simply uses the >> rule, which IMHO shouldn't easily be disabled (but >> should still respect

Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andy Feldman
On Tue, Sep 15, 2020 at 1:12 PM Andreas Sewe wrote: > My situation is unfortunately a bit more complex than that, as I have > *two* s of the maven-enforcer-plugin, only one of which > should be affected by -DskipChecks. The other simply uses the > rule, which IMHO shouldn't easily be disabled

Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andreas Sewe
Andy Feldman wrote: > I guess you don't even need a custom property since each plugin tends to > have one already. So a simpler property-based approach would just be: > > > ${skipChecks} > > > And maybe you'd also need false in your properties > to provide a default for when skipChecks isn't

Re: Why does POM have precedence over -D property expressions?

2020-09-15 Thread Andreas Sewe
Oliver B. Fischer wrote: > 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: >

Re: Why does POM have precedence over -D property expressions?

2020-09-14 Thread Oliver B. Fischer
-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:

Re: Why does POM have precedence over -D property expressions?

2020-09-14 Thread Tomo Suzuki
> *any* explicit pom.xml cannot be overridden by a property expression given on > the command line. I also encountered the problem when my Maven project has multiple main classes and I wanted to run them by switching "mvn exec:java -Dexec.mainClass=...' while keeping the default one in pom.xml.

Re: Why does POM have precedence over -D property expressions?

2020-09-14 Thread Andy Feldman
I guess you don't even need a custom property since each plugin tends to have one already. So a simpler property-based approach would just be: ${skipChecks} And maybe you'd also need false in your properties to provide a default for when skipChecks isn't specified on the command line. But

Re: Why does POM have precedence over -D property expressions?

2020-09-14 Thread Andy Feldman
I agree this behavior is unexpected. But it's different for properties! So a workaround here is to have a unique property for each check you want to skip, so that you can override the property by command line rather than overriding the configuration directly. Then you can have a single way to set

Why does POM have precedence over -D property expressions?

2020-09-14 Thread Andreas Sewe
Hi, I am currently sprinkling child elements like the following through my (parent) POMs for enforcer:enforce, tidy:check and checkstyle:check : ${skipChecks} 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