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 2022/03/26 09:43:00 UTC

[jira] [Closed] (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:all-tabpanel ]

Konrad Windszus closed JCRVLT-566.
----------------------------------

> "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.3.0
>
>
> 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.20.1#820001)