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

Robert Munteanu commented on SLING-8874:
----------------------------------------

If sourceId is specified there is no need for the bundle header. On the other 
hand, that information is easy to find out for the bundle packager, and hard to 
find for the feature model maintainer.

As an example, here are some bundles that are "hard" to supply information for:

* oak-lucene: 
{{org.apache.jackrabbit:oak-lucene:jar:sources:${oak.version},org.apache.lucene:lucene-core:jar:sources:4.7.1,org.apache.lucene:lucene-analyzers-common:jar:sources:4.7.1,org.apache.lucene:lucene-queryparser:jar:sources:4.7.1,org.apache.lucene:lucene-queries:jar:sources:4.7.1,org.apache.lucene:lucene-suggest:jar:sources:4.7.1,org.apache.lucene:lucene-highlighter:jar:sources:4.7.1,org.apache.lucene:lucene-memory:jar:sources:4.7.1,org.apache.lucene:lucene-misc:jar:sources:4.7.1,org.apache.lucene:lucene-facet:jar:sources:4.7.1}}
* httpclient-osgi: 
{{org.apache.httpcomponents:httpclient-osgi:jar:sources:4.5.4,org.apache.httpcomponents:httpclient:jar:sources:4.5.4,org.apache.httpcomponents:fluent-hc:jar:sources:4.5.4,org.apache.httpcomponents:httpclient-cache:jar:sources:4.5.4,org.apache.httpcomponents:httpmime:jar:sources:4.5.4}}

It would be much easier for whatever tooling generates the wrapping to record 
that information in the Manifest. Maybe this is something that should go in 
{{bnd}} and then, if we get consensus, be supported by the {{ApisJarsMojo}} ?

> Support a manifest property that indicates alternate source artifacts
> ---------------------------------------------------------------------
>
>                 Key: SLING-8874
>                 URL: https://issues.apache.org/jira/browse/SLING-8874
>             Project: Sling
>          Issue Type: Improvement
>          Components: Feature Model
>            Reporter: Robert Munteanu
>            Priority: Major
>
> The {{ApiJarsMojo}} already supports looking for alternate artifacts based on 
> {{sourceId}} property located in feature model files. This is useful for 
> scenarios where the bundle can not be easily changed, but has some 
> disadvantages:
> - it requires inspecting the bundle that has a {{ sourceId }} property
> - it can become out of date if the bundle is changed but the {{sourceId}} is 
> not.
> {code}
> Alternate-Source-Artifacts: bundle-a, bundle-b, bundle-c
> {code}
> This would in turn be inspected by the {{ApiJarsMojo}} and handled in the 
> same manner that the {{sourceId}} is.
> Additionally, while working with the {{ sourceId }} property I have 
> discovered two patterns of use:
> 1. The artifact repackages one or more artifacts, e.g. 
> [org.apache.sling.javax.activation|https://github.com/apache/sling-org-apache-sling-javax-activation]
> 2. The artifact includes some code and in addition repackages some artifacts, 
> e.g. 
> [org.apache.httpcomponents.httpclient-osgi|https://github.com/apache/httpcomponents-client/tree/4.5.x/httpclient-osgi]
> I would therefore suggest that we a {{mode}} argument to both the 
> {{sourceId}} and the manifest header:
> * {{mode=add}} - adds the specified sources jars to the list of source 
> artifacts and keeps the auto-generated one ( bundle with classifier = sources 
> )
> * {{mode=replace}} - adds the specified sources jar to the list of source 
> artifacts and does not keep the auto-generated one
> I think that - at least of jar files that we can change ourselves - this will 
> make maintaining source artifact mappings easier.



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

Reply via email to