Tested ./mvn/maven.config and it works... thanks 🙂 and it's in SCM...

This is probably my preferred place for such things as the other places are more ephemeral... and I learned a new Maven trick 😎

Thanks for the explanation of 'project properties' and I can understand such implementation issues. The only cure really is in the diagnostic message, and it looks you're on top of that... and many thanks there too.

As an aside, I don't use Maven as much these days as the team I am on are (overly) committed to Gradle. Compared to Maven, Gradle is very low quality with respect to large projects. We are considering Idiomatic Gradle <https://github.com/jjohannes/idiomatic-gradle>, but that adds another layer of complexity because native Gradle lacks important features.

Your responses to my email prove that the Maven maintainers are far more professional in how they treat the product and consumers.

Cheers, Eric

On 2023-10-09 3:20 a.m., Tamás Cservenák wrote:
And addendum:

Yet another way to set this "for good": using .mvn/maven.config:
https://gist.github.com/cstamas/0f07b4b045ae5c98f60ecd530f928201

I think this above is what you want, as I assume you wanted to enable
validation for the project (in which POM you defined this property) and
have it enabled always. This file .mvn/maven.config should be checked in
into SCM along with POMs and sources, and you are good to go.

On Mon, Oct 9, 2023 at 12:02 PM Tamás Cservenák<ta...@cservenak.net>  wrote:

Errata:
my "as Maven System Property" example is wrong (I had leftover `export
MAVEN_OPTS` from previous run)... so please neglect that example.

On Mon, Oct 9, 2023 at 11:58 AM Tamás Cservenák<ta...@cservenak.net>
wrote:

Howdy Eric,

You are right, and sorry for this, I am (we all are) a bit overwhelmed
these days....

So you are right, that line should say "use 'maven.plugin.validation'
**user** property". User properties (as told by mvn -h) are defined by the
"-D" CLI switch.

Re adding URL to message: Herve started already doing that, and many
thanks to him for improving the horrible UX of this (IMHO important)
feature.
For start, he started refining the page and add it to release notes:
https://github.com/apache/maven-site/pull/461

And finally, regarding my answer to the 2nd part... to me it seems that
the message was not fully delivered (for a non-core developer, it may, but
for sake of completeness let me elaborate it):

I just wanted to explain why Project Property CANNOT be used here... as
if you think about Maven starting: JVM boots and Java System Properties are
available, then Maven core "boots" (where Maven System Properties and Maven
User Properties are assembled), and once booted, only then is model being
loaded/parsed/built.

Now, this where the validation should kick in (either for plugins defined
in current project POM or in current project but with plugin goal directly
invoked on CLI), hence, Project Properties (those on POM) are simply put
"too late" for this, or are like chicken-and-egg problem (to load, we need
to validate, but to report validation issues we need properties loaded).

In conclusion, `maven.plugin.validation` may be defined as ANY Maven
property EXCEPT Project property :)

Examples (did them on maven-3.9.x branch of
https://github.com/apache/maven):

- as Java System Property:
https://gist.github.com/cstamas/ecb5170d61de79117c4181c7f3cbfe78
- as Maven System Property (env):
https://gist.github.com/cstamas/a03eacc66a01eb12896199d846ebc339
- as Maven User Property:
https://gist.github.com/cstamas/14d5aed712720d558bff704944f46d21

HTH
Tamas

On Sun, Oct 8, 2023 at 11:51 PM Eric Kolotyluk<eric.koloty...@gmail.com>
wrote:

Wow... great response...

Since you offered such a thoughtful response, I will try to do
likewise...

As someone who used to teach UI/UX in a third year university course,
and now an old curmudgeon 😉, if I am going to see a message like

[WARNING] For more or less details, use 'maven.plugin.validation'
property with one of the values (case insensitive): [BRIEF, DEFAULT,
VERBOSE]

I should not have to care what kind of property I am dealing with
because the message lacks context.

Now, in many places I admire the skill, craftsmanship, intelligence, and
pure genius of Maven maintainers who add hyperlinks to their messages
for more context.  Indeed, a link to this amazing bit of knowledge,
https://maven.apache.org/guides/plugins/validation/index.html, would
have added such context. Maybe I should get off my lazy ass, fork the
repo, make the change, and submit a pull request...

In the larger picture, these distinctions over properties is, IMHO,
unnecessary complexity to the UX. Good design leverages good intuition.
IMHO, the plugin should accept the project property
maven.plugin.validation, but I am willing to entertain a cogent argument
why this should not be the case.

And thanks again for such a great response. I really enjoyed following
your explanation and references, and understanding better.

Cheers, Eric

P.S. Dealing with Maven people is way easier than Gradle people...

On 2023-10-08 3:49 a.m., Tamás Cservenák wrote:
Howdy,

regarding plugin validation we have this documentation
https://maven.apache.org/guides/plugins/validation/index.html

that tries to explain what's and why's (given naming is constantly
brought
up, let me tell in advance, the output uses "currently built project
POV",
so internal issue is something one can fix by editing POM, while
external
issue depends on external plugin, that needs fix and new release).

As it stands on page, the `maven,plugin.validation` property is "maven
user
property" (set with -D on cli) and is not "Maven project property",
hence
setting it in POM/properties does not make sense (nor has it's effect).
This should be done in `.mvn/maven.config` instead, if you want it
always
ON.

On the other hand, as we talk about properties, I'd like to remind you
about other change ongoing in 3.9.x line, that is the cleanup of
property
notion: in Maven (and Java) land, we deal with:
- Java System Properties
- Maven System Properties
- Maven User Properties
- Maven Project Properties

In release notes "Breaking changes" there is last bullet that gives
some
hint about these:

https://maven.apache.org/docs/3.9.5/release-notes.html#potentially-breaking-core-changes-if-migrating-from-3-8-x
HTH
Tamas

On Sat, Oct 7, 2023 at 11:57 PM Eric Kolotyluk <
eric.koloty...@gmail.com>
wrote:

When I run

      |mvn clean site -Dmaven.plugin.validation=VERBOSE|

I get verbose output, but when I put the following in my pom.xml

         <properties>
      <maven.plugin.validation>VERBOSE</maven.plugin.validation>
         </properties>

and run

      |mvn clean site|

    I do not. Instead, I just get

      [WARNING]
      [WARNING] Plugin validation issues were detected in 3 plugin(s)
      [WARNING]
      [WARNING]  * org.apache.maven.plugins:maven-site-plugin:4.0.0-M8
      [WARNING]  *
org.apache.maven.plugins:maven-surefire-report-plugin:3.1.2
      [WARNING]  *
      org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.5
      [WARNING]
      [WARNING] For more or less details, use 'maven.plugin.validation'
      property with one of the values (case insensitive): [BRIEF,
DEFAULT,
      VERBOSE]
      [WARNING]

Can someone please help me understand what is going on here?

Here is some context...

      $ mvn -version
      Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
      Maven home: C:\Program Files (Open)\Apache\apache-maven-3.9.5
      Java version: 21, vendor: Oracle Corporation, runtime: C:\Program
      Files\java\jdk-21
      Default locale: en_CA, platform encoding: UTF-8
      OS name: "windows 10", version: "10.0", arch: "amd64", family:
      "windows"

Cheers, Eric

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

Reply via email to