sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomek Rękawek (JIRA) <j...@apache.org>
Subject [jira] [Commented] (SLING-7054) Slingstart artifacts with parametrized version not removed from the effective slingstart model
Date Fri, 18 Aug 2017 07:10:01 GMT

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

Tomek Rękawek commented on SLING-7054:
--------------------------------------

Attached the patch proposal. It exposes the ModelResolveUtility#resolve() method in the provisioning-model.
Alternatively, we can process the rawModel in the upstream methods, so it won't contain unresolved
variables.

We can split the patch to two parts, so it won't modify a few Sling modules at once.

[~cziegeler], WDYT?

> Slingstart artifacts with parametrized version not removed from the effective slingstart
model
> ----------------------------------------------------------------------------------------------
>
>                 Key: SLING-7054
>                 URL: https://issues.apache.org/jira/browse/SLING-7054
>             Project: Sling
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Tomek Rękawek
>            Priority: Minor
>             Fix For: Slingstart Maven Plugin 1.7.8
>
>         Attachments: SLING-7054.patch
>
>
> Adding a following entry to the provisioning model:
> {noformat}
> [artifacts]
>   com.acme/my-model/1.0.0/slingstart
> {noformat}
> results in including the my-model to the current one. The slingfeature file will be downloaded
and merged. However, if we replace the version with a variable:
> {noformat}
> [artifacts]
>   com.acme/my-model/${my.model.version}/slingstart
> {noformat}
> the slingstart will also download and include the my-model.jar file, not useful here.
> It's a result of the lines [345-356|https://github.com/apache/sling/blob/7e8a3a110a29b743d49ef799a7c7dec50a90bd96/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/ModelPreprocessor.java#L345-L357]
in the {{ModelPreprocessor}}:
> {code}
>                     for(final org.apache.sling.provisioning.model.Artifact r : removeList)
{
>                         group.remove(r);
>                         final Feature localModelFeature = rawModel.getFeature(feature.getName());
>                         if ( localModelFeature != null ) {
>                             final RunMode localRunMode = localModelFeature.getRunMode(runMode.getNames());
>                             if ( localRunMode != null ) {
>                                 final ArtifactGroup localAG = localRunMode.getArtifactGroup(group.getStartLevel());
>                                 if ( localAG != null ) {
>                                     localAG.remove(r);
>                                 }
>                             }
>                         }
>                     }
> {code}
> If the artifact is parametrized, it won't be removed from the localAG.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message