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

Neil Bartlett commented on FELIX-5527:
--------------------------------------

The exemplar project can be made to work by adding the following configuration 
for the maven-bundle-plugin:

{noformat}
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <instructions>
              <_fixupmessages>"Classes found in the wrong 
directory";is:=warning</_fixupmessages>
            </instructions>
          </configuration>
        </plugin>
{noformat}

Note that the classes under META-INF/versions will not be seen or used by OSGi. 
There needs to be enhanced runtime support for this because the 
version-specific classes could have their own dependencies (e.g. imports), and 
OSGi does not support dependencies that are conditional upon the Java runtime 
version. The above snippet simply converts the error to a warning allowing you 
to still build a bundle.


> Bundle plugin Embed-Dependency complains about class files in META-INF
> ----------------------------------------------------------------------
>
>                 Key: FELIX-5527
>                 URL: https://issues.apache.org/jira/browse/FELIX-5527
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-3.2.0
>         Environment: Linux copperhead 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 
> 07:24:34 CET 2016 x86_64 GNU/Linux
> openjdk version "1.8.0_121"
> OpenJDK Runtime Environment (build 1.8.0_121-b13)
> OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
> Apache Maven 3.3.9 (NON-CANONICAL_2015-11-23T13:17:27+03:00_root; 
> 2015-11-23T10:17:27+00:00)
> Maven home: /opt/maven
> Java version: 1.8.0_121, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/java-8-openjdk/jre
> Default locale: en_GB, platform encoding: UTF-8
> OS name: "linux", version: "4.8.13-1-arch", arch: "amd64", family: "unix"
>            Reporter: Mark Raynsford
>              Labels: maven
>
> As of Java 9, it's no longer a mistake to have included class files in the 
> META-INF directory of a bundle. However, if the Embed-Dependency instruction 
> is used to pack the contents of a jar file into a bundle, and the original 
> jar file happened to have class files in META-INF, the execution fails with 
> an error.
> A repro case is included in the following repository:
> https://github.com/io7m/maven-bundle-plugin-bug-20170207
> Just "mvn clean package".



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

Reply via email to