Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do you set the "maven.plugin.validation" property?

Tags:

maven

I've just upgraded to Maven 3.9.2, and at the end of my build I get the warning:

Plugin validation issues were detected in 4 plugin(s)

 * org.apache.maven.plugins:maven-dependency-plugin:3.5.0
 * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
 * org.apache.maven.plugins:maven-pmd-plugin:3.20.0
 * org.apache.maven.plugins:maven-resources-plugin:3.3.0

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

However, it doesn't tell me where I should set that property!

I've tried in my pom.xml file itself:

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

...but that seems to make no difference. In fact, it seems to be completely ignore, since setting it to an invalid value doesn't get noticed (according to maven's own code it should raise a warning).

I'm obviously missing something, but have run out of ideas on what to search for to find it! Thanks for any assistance.

like image 944
davejbur Avatar asked Sep 01 '25 16:09

davejbur


2 Answers

You can define a property using the following option on the command line:

-Dmaven.plugin.validation=VERBOSE

This is the option most frequently used to customize Maven plugins' behavior. You could trigger the install action, for example:

mvn install -Dmaven.plugin.validation=VERBOSE
like image 148
Marcelo Rodrigo Avatar answered Sep 05 '25 07:09

Marcelo Rodrigo


maven.plugin.validation property is used by Maven itself, so it can not be configured in project pom.xml

As mentioned in previous answer it can be set on command line.

It can be also added to project file .mvn/maven.config - so you can have configuration on project level.

It can also be added to properties in ~/.m2/settings.xml and you will have configuration on system level.

There is example of settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">

    <!-- properties can be defined only in profile, so create one -->
    <profiles>
        <profile>
            <id>properties</id>
            <properties>
                <maven.plugin.validation>VERBOSE</maven.plugin.validation>
            </properties>
        </profile>
    </profiles>

    <activeProfiles>
        <!-- profile with properties must be activated with a static way -->
        <activeProfile>properties</activeProfile>
    </activeProfiles>

</settings>

Please consult: Plugin Validation

like image 23
Slawomir Jaranowski Avatar answered Sep 05 '25 07:09

Slawomir Jaranowski