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

Konrad Windszus updated JCRVLT-566:
-----------------------------------
    Description: 
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].

Maven unfortunately does not emit any error due to the failed exception but 
just creates a null entry in the validatorSettings collection.

Workaround is to use uppercase String for "defaultSeverity" like 
{{DEBUG}},{{INFO}},{{WARN}} and {{ERROR}}

  was:
When using a configuration like

{code}
<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}
[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.

Maven unfortunately does not emit any error due to the failed exception but 
just creates a null entry in the validatorSettings collection.

Workaround is to use uppercase String for "defaultSeverity" like 
{{DEBUG}},{{INFO}},{{WARN}} and {{ERROR}}


> "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].
> Maven unfortunately does not emit any error due to the failed exception 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)

Reply via email to