[ 
https://issues.apache.org/jira/browse/FELIX-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595096#action_12595096
 ] 

Stuart McCulloch commented on FELIX-548:
----------------------------------------

That is correct - the bundleplugin only adds the compile and runtime 
dependencies to the classpath passed to BND.

This has always been the case, since before I joined the project - the bundle 
mojo has @requiresDependencyResolution set to runtime, which means Maven will 
only resolve the compile and runtime dependencies on the project classpath, not 
provided ones (AFAIK Maven doesn't allow you to set it to provided, and if you 
omit this tag then you inherit whatever classpath was resolved by previous 
plugins, which could lead to unreproducible builds).

A beneficial side-effect of this setting is that it avoids people accidentally 
including content from other bundles (ie. scope provision) when setting 
Export-Package:*, etc. Removing this setting to add provision dependencies to 
the BND classpath would definitely break large numbers of existing projects 
that rely on this behavior.

The unfortunate side-effect is that you lose automatic versioning of imports 
which means that you need to add versions and ranges explicitly - but again, a 
lot of projects seem to prefer this rather than nailing down imports to a 
specific version by default.

> Import-Package version qualifiers vary depending on dependency scope.
> ---------------------------------------------------------------------
>
>                 Key: FELIX-548
>                 URL: https://issues.apache.org/jira/browse/FELIX-548
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.0
>         Environment: N/A
>            Reporter: Thomas Dewire
>            Priority: Minor
>         Attachments: bugtest3.tar.gz
>
>
> The produced Import-Package directive appears to vary depending on the 
> declared scope of a dependency.
> Assuming that a dependency is a valid OSGi bundle:
> - "compile" scope will include a version qualifier (eg. Import-Package: 
> org.springframework.core;version="2.5.4").
> - "provided" scope will not include a version qualifier (eg. Import-Package: 
> org.springframework.core).
> In this case, I believe the 'compile' behavior is correct.
> I have not tested all possible scopes. A similar inconsistency might exist 
> for runtime, test, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to