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

Stuart McCulloch commented on FELIX-3133:
-----------------------------------------

The import is there because the com.example.internal package is *not* being 
added to the bundle - you can see this by listing the bundle contents:

$ mvn clean install
$ unzip -l target/example-0.1.0-SNAPSHOT.jar

Archive:  target/example-0.1.0-SNAPSHOT.jar
  Length     Date   Time    Name
 --------    ----   ----    ----
      334  09-26-11 00:33   META-INF/MANIFEST.MF
        0  09-26-11 00:33   META-INF/
        0  09-26-11 00:33   META-INF/maven/
        0  09-26-11 00:33   META-INF/maven/com.example/
        0  09-26-11 00:33   META-INF/maven/com.example/example/
      136  09-26-11 00:33   META-INF/maven/com.example/example/pom.properties
     1283  09-26-11 00:23   META-INF/maven/com.example/example/pom.xml
        0  09-26-11 00:33   com/
        0  09-26-11 00:33   com/example/
      111  09-26-11 00:33   com/example/Something.class
 --------                   -------
     1864                   10 files

The reason the com.example.internal package is not added is because you only 
list the com.example package in Private-Package:

   <Private-Package>com.example</Private-Package>

and because the com.example.internal package is neither exported or marked as a 
private package, bnd doesn't pull it into the bundle:

   
http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html#ApacheFelixBundlePluginFAQ-WhenIbuildabundle%252Csomeclassesarebuiltin%2522target%252Fclasses%2522butthey%2527renotincludedinthefinaljar.

To include all packages under com.example you could use a wildcard:

   <Private-Package>com.example.*</Private-Package>

Or, if the com.example packages are from the local project, just remove the 
Private-Package instruction and rely on the defaults (which will set 
Private-Package to include all packages in the local project).

> Maven bundle plugin adds Import-Package for the Bundle-Activator
> ----------------------------------------------------------------
>
>                 Key: FELIX-3133
>                 URL: https://issues.apache.org/jira/browse/FELIX-3133
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.3.4, maven-bundle-plugin-2.3.5
>            Reporter: Lucas Galfaso
>            Priority: Minor
>         Attachments: example.zip
>
>
> When there is a <Bundle-Activator> that references a class that is not 
> exported, the generated manifest contains an Import-Package to the package 
> that this activator is at. There is no requirement to export the package that 
> exports the activator, so this behavior leads to the fact that generated 
> package will never be resolved.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to