You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2016/01/11 18:08:39 UTC
[jira] [Commented] (FELIX-2991) Allow the creating of fragments
that populate Export-Package
[ https://issues.apache.org/jira/browse/FELIX-2991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15092285#comment-15092285 ]
Konrad Windszus commented on FELIX-2991:
----------------------------------------
Indeed maven-bundle-plugin 2.4.0 fixed it. This pom.xml does work now
{code:xml}
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>somegroup</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>system-fragment-xml-api</artifactId>
<packaging>bundle</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Fragment-Host>
system.bundle;extension:=framework
</Fragment-Host>
<Export-Package>
javax.xml.ws.wsaddressing,
javax.jws,
javax.jws.soap,
javax.activation;version=1.1.1
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
{code}
There are only three warning emitted during build:
{quote}
[WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : Classpath is empty. Private-Package (-privatepackage) and Export-Package can only expand from the classpath when there is one
[WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : Unused Private-Package instructions, no such package(s) on the class path: [!*]
[WARNING] Bundle somegroup:system-fragment-xml-api:bundle:1.0-SNAPSHOT : The JAR is empty: The instructions for the JAR named somegroup.system-fragment-xml-api did not cause any content to be included, this is likely wrong
{quote}
Nevertheless the generated JAR contains the correct manifest. Therefore I assume this can be closed as FIXED with version 2.4.0.
Even in the current version 3.0.1 it does still work (with the same warnings).
The only thing which may be improved here still is that the warnings in case of fragments should not be emitted (because it is totally valid for a fragment to not include any classes).
> Allow the creating of fragments that populate Export-Package
> -------------------------------------------------------------
>
> Key: FELIX-2991
> URL: https://issues.apache.org/jira/browse/FELIX-2991
> Project: Felix
> Issue Type: New Feature
> Components: Maven Bundle Plugin
> Reporter: Michael Van Geertruy
> Fix For: maven-bundle-plugin-future
>
>
> When using the maven-bundle-plugin to create fragments which add export-packages to a host bundle, the maven-bundle-plugin considers all of the export-packages as superfluous, does not add them to the fragment's MANIFEST.MF file and fails to compile.
> The specific case is when attempting to add exports to a bundle where bnd-wrapping doesn't pick up all of the necessary packages. For example, when executing this line in Karaf:
> osgi:install -s mvn:tibco/tibco-crypt/5.1.2
> The wrap command skips over a number of packages. So creation of a fragment is necessary. However, the build fails for the above noted reason. The work-around for this issue is to use the maven-jar-plugin to create the fragment.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)