[
https://issues.apache.org/jira/browse/SLING-11734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17647655#comment-17647655
]
Carsten Ziegeler commented on SLING-11734:
------------------------------------------
I'm not sure if this is the right solution, it works for this case as the
bundle happens to have the same group id as the content package. But what if
this bundle would be in a content package which has the group id "foo.bar" ?
So I think, instead of comparing the group id, it is probably better to iterate
over all possible candidates, pick the ones which match the version. If there
is one, we pick that one. If there is more than one, we can check the artifact
id. If there is still more than one (very unlikely) we can use the group id
from the parent package or randomly pick one.
> ContentPackageScanner does not extract the right artifactId in case of
> multiple pom.properties
> ----------------------------------------------------------------------------------------------
>
> Key: SLING-11734
> URL: https://issues.apache.org/jira/browse/SLING-11734
> Project: Sling
> Issue Type: Bug
> Components: Feature Model Analyser
> Reporter: Niek Raaijmakers
> Priority: Major
>
> Currently, the ContentPackageScanner gets the first directory available under
> the maven meta-inf folder.
> This works most of the time, as there is usually only 1 properties file
> inside a package.
>
> However in some edge cases, there are multiple. And if the order is that in a
> way that a different package comes first, such as com.google.guava , it will
> take that one instead.
> Example we are extracting com.acs.aem.acs-aem-commons-content-5.4.3.zip >
> acs-aem-commons-bundle-5.3.4.jar
> The META-INF/maven folder contains:
> com.google.guava/failureaccess/pom.properties
> com.adobe.acs/acs-aem-commons-bundle/pom.properties
>
> Now, the first is picked, com.google.guava/failureaccess/pom.properties
>
> What we want is to build in a mechanism that if there are multiple maven
> properties, the contentpackagescanner will check if one of them has a groupId
> (first folder) that matches.
>
> Since the groupId com.adobe.acs is a match, we can use that to pick the right
> properties file.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)