[ 
https://issues.apache.org/jira/browse/MNG-7183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin D'Aloia updated MNG-7183:
--------------------------------
    Description: 
Declaring a plugin where its {{<groupId>}} value is/contains a property 
reference ({{$\{example}}}) is silently ignored and no error is thrown since 
Maven 3.6.2 (worked on 3.6.1).

*Actual behavior:*
 - Plugin configuration silently ignored

*Expected behavior:*
 - Work as in 3.6.1, or
 - Produce an error if such config is not allowed

*Workaround:*
 * Use a static value for the <groupId> without property references

*Suspecting root cause:*
 * MNG-6697

Attached you could find a self-contained example using the 
{{maven-clean-plugin}} (but also happens with third-party plugins).
 To ease the comparison, this has 2 profiles: one declares the value explicitly 
and the other (indirect) via a property reference.

Execute it as: {{./run.sh}}
 and you will get at the end:
{noformat}
./out/maven-3.8.1-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.3-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.2-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
{noformat}
Here you could see that the plugin version (2.5) and skip (false) configuration 
isn't what was configured for {{indirect}} profile.

Another example, defining a base config as {{<pluginManagement>}}, it is also 
ignoring the specific {{<configuration>}} on {{<plugin>}} usage.

Execute it as: {{./run.sh pom-pluginManagement.xml}}
 and you will get at the end:
{noformat}
./out/maven-3.8.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.3-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.2-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
{noformat}
 

  was:
Declaring a plugin where its {{<groupId>}} value is/contains a property 
reference ({{${example}}}) is silently ignored and no error is thrown since 
Maven 3.6.2 (worked on 3.6.1).

*Actual behavior:*
 - Plugin configuration silently ignored

*Expected behavior:*
 - Work as in 3.6.1, or
 - Produce an error if such config is not allowed

Attached you could find a self-contained example using the 
{{maven-clean-plugin}} (but also happens with third-party plugins).
To ease the comparison, this has 2 profiles: one declares the value explicitly 
and the other (indirect) via a property reference.

Execute it as: {{./run.sh}}
and you will get at the end:

{noformat}
./out/maven-3.8.1-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.3-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.2-profile-indirect.log:[INFO] --- maven-clean-plugin:2.5:clean 
(default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
{noformat}

Here you could see that the plugin version (2.5) and skip (false) configuration 
isn't what was configured for {{indirect}} profile.

Another example, defining a base config as {{<pluginManagement>}}, it is also 
ignoring the specific {{<configuration>}} on {{<plugin>}} usage.

Execute it as: {{./run.sh pom-pluginManagement.xml}}
and you will get at the end:

{noformat}
./out/maven-3.8.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.3-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.2-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
{noformat}
 


> Plugin declaration silently ignored if groupId uses property references
> -----------------------------------------------------------------------
>
>                 Key: MNG-7183
>                 URL: https://issues.apache.org/jira/browse/MNG-7183
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap &amp; Build, Inheritance and Interpolation
>    Affects Versions: 3.6.2, 3.6.3, 3.8.1
>            Reporter: Martin D'Aloia
>            Priority: Minor
>         Attachments: bug-example.zip
>
>
> Declaring a plugin where its {{<groupId>}} value is/contains a property 
> reference ({{$\{example}}}) is silently ignored and no error is thrown since 
> Maven 3.6.2 (worked on 3.6.1).
> *Actual behavior:*
>  - Plugin configuration silently ignored
> *Expected behavior:*
>  - Work as in 3.6.1, or
>  - Produce an error if such config is not allowed
> *Workaround:*
>  * Use a static value for the <groupId> without property references
> *Suspecting root cause:*
>  * MNG-6697
> Attached you could find a self-contained example using the 
> {{maven-clean-plugin}} (but also happens with third-party plugins).
>  To ease the comparison, this has 2 profiles: one declares the value 
> explicitly and the other (indirect) via a property reference.
> Execute it as: {{./run.sh}}
>  and you will get at the end:
> {noformat}
> ./out/maven-3.8.1-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:2.5:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.3-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:2.5:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.2-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:2.5:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
> {noformat}
> Here you could see that the plugin version (2.5) and skip (false) 
> configuration isn't what was configured for {{indirect}} profile.
> Another example, defining a base config as {{<pluginManagement>}}, it is also 
> ignoring the specific {{<configuration>}} on {{<plugin>}} usage.
> Execute it as: {{./run.sh pom-pluginManagement.xml}}
>  and you will get at the end:
> {noformat}
> ./out/maven-3.8.1-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.8.1-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.8.1-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.8.1-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.3-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.3-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.6.3-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.3-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.2-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.2-profile-indirect.log:[DEBUG] (f) skip = false
> ./out/maven-3.6.2-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.2-profile-explicit.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.1-profile-indirect.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.1-profile-indirect.log:[DEBUG] (f) skip = true
> ./out/maven-3.6.1-profile-explicit.log:[INFO] --- 
> maven-clean-plugin:3.1.0:clean (default-clean) @ maven-bug-example ---
> ./out/maven-3.6.1-profile-explicit.log:[DEBUG] (f) skip = true
> {noformat}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to