You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/10/22 07:55:00 UTC

[jira] [Commented] (JCRVLT-566) "validatorSettings" does no longer detect lowercase values for "defaultSeverity"

    [ https://issues.apache.org/jira/browse/JCRVLT-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17432849#comment-17432849 ] 

Konrad Windszus commented on JCRVLT-566:
----------------------------------------

This does not affect all Java versions/OS combinations for some reason, seems that the injection logic differs slightly. Could reproduce with always on Java 8 (no matter which OS) and with Java 11 and 17 only on Windows.

> "validatorSettings" does no longer detect lowercase values for "defaultSeverity"
> --------------------------------------------------------------------------------
>
>                 Key: JCRVLT-566
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-566
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: package maven plugin
>    Affects Versions: package-maven-plugin-1.2.2
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: package-maven-plugin-1.2.4
>
>
> When using a configuration like
> {code:java}
> <configuration>
>   <validatorSettings>
>     <netcentric-aem-classification>
>       <defaultSeverity>warn</defaultSeverity>
>      <options>
>         <!-- references the classification.map from the ThreadContextClassLoader, might contain multiple maps (comma-separated) -->
>         <maps>tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-deprecations/coral2deprecations.map,tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-deprecations/graniteuideprecations.map,tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-repo-annotations.map</maps>
>       </options>
>     </netcentric-aem-classification>
>     ...
>   </validatorsSettings>
> </configuration> 
> {code}
> You see the following in the Maven log
> {code:java}
> [WARNING] Map in class org.apache.jackrabbit.filevault.maven.packaging.ValidatePackageMojo declares value type as: class org.apache.jackrabbit.filevault.maven.packaging.ValidatorSettings but saw: null at runtime
> {code}
> This is due to the fact that the complex object ValidatorSettings can not be injected, as the wrong setter method for {{defaultSeverity}} is called, i.e. [https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/36aeeb9ba39dbc1c683bad659fd0d1d9983dcd54/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/ValidatorSettings.java#L61] instead of [https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/36aeeb9ba39dbc1c683bad659fd0d1d9983dcd54/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/ValidatorSettings.java#L54] so the logic from https://maven.apache.org/guides/plugin/guide-java-plugin-development.html#enums is applied.
> Maven unfortunately does not emit any error due to the failed injection but just creates a null entry in the validatorSettings collection.
> Workaround is to use uppercase String for "defaultSeverity" like {{DEBUG}},{{INFO}},{{WARN}} and {{ERROR}}



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