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

Stefan Seifert edited comment on JCRVLT-556 at 9/2/21, 8:39 AM:
----------------------------------------------------------------

there is a conceptual problem in 
https://github.com/apache/jackrabbit-filevault/blob/d759ef289e6f46c652288af8ddc6d5cb42da3281/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidator.java#L108

i've debugged, and the input to this method is (in my case on windows): 
{{content\filevaultsample\en\tools\config\.content.xml}}

ValidationExecutor.filePathToNodePath translates this to 
{{/content/filevaultsample/en/tools/config/.content.xml}} - which is imho not 
correct, because the ".content.xml" is not part of the node path, only part of 
the file system layout.

this (wrong) node path than is flagged as "this is an osgi config", because if 
it would be something other than .content.xml it's likely an osgi config.

i could provide a PR to add asserts for paths like this and fix the regex 
excluding it, but is it correct that ValidationExecutor.filePathToNodePath 
translates the file system path this way?


was (Author: [email protected]):
there is a conceptual problem in 
https://github.com/apache/jackrabbit-filevault/blob/d759ef289e6f46c652288af8ddc6d5cb42da3281/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidator.java#L108

i've debugged, and the input to this method is (in my case on windows): 
{{content\filevaultsample\en\tools\config\.content.xml}}

ValidationExecutor.filePathToNodePath translates this to 
{{/content/filevaultsample/en/tools/config/.content.xml}} - which is imho not 
correct, because the ".content.xml" is not part of the node path, only part of 
the file system layout.

this (wrong) node path than is flagged as "this is an osgi config", because if 
it would be something other than .content.xml it's likely an osgi config.

i could provide a PR to add assets for paths like this and fix the regex 
excluding it, but is it correct that ValidationExecutor.filePathToNodePath 
translates the file system path this way?

> jackrabbit-packagetype validator wrongly complains about OSGI configurations 
> in tools/config path
> -------------------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-556
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-556
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: validation
>    Affects Versions: 3.5.2
>            Reporter: Stefan Seifert
>            Priority: Major
>             Fix For: 3.5.4
>
>
> scenario: content package project
> https://github.com/stefanseifert/filevault-package-maven-plugin-validation-issues/tree/master/content-packages/sample-content
> compile package with filevault-package-maven-plugin 1.1.9-SNAPSHOT using 
> filevault 3.5.2
> validation fails with:
> {noformat}
> [ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 
> 'CONTENT' is not supposed to contain OSGi bundles or configurations!", 
> filePath=jcr_root\content\filevaultsample\en\tools\config\.content.xml, 
> nodePath=/content/filevaultsample/en/tools/config, line=3
> [ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 
> 'CONTENT' is not supposed to contain OSGi bundles or configurations!", 
> filePath=jcr_root\content\filevaultsample\en\tools\config\.content.xml, 
> nodePath=/content/filevaultsample/en/tools/config/jcr:content, line=8
> {noformat}
> but this is wrong, as the folder does not contain any OSGi configurations or 
> bundle. it simply has the name /config - but this surely is not enough to 
> "prove" it's illegal in a CONTENT package? any CMS user may create a path 
> with a name like this.



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

Reply via email to