Petr Dolezal created FELIX-6195:
-----------------------------------

             Summary: maven-bundle-plugin adds module-info.java into 
OPT-INF/src twice
                 Key: FELIX-6195
                 URL: https://issues.apache.org/jira/browse/FELIX-6195
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-4.2.1
            Reporter: Petr Dolezal


When adding sources to the generated bundle and having {{module-info.java}} 
present, this file appears in the artifact's {{OPT-INF/src}} twice.

Technically, it seems that some entries are duplicated in a peculiar way. 
Running {{jar --list}} on the artifact produced from the sources listed below 
shows:
{noformat}
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/com.example/
META-INF/maven/com.example/com.example/
META-INF/maven/com.example/com.example/pom.properties
META-INF/maven/com.example/com.example/pom.xml
OSGI-OPT/
OSGI-OPT/src/
OSGI-OPT/src//
OSGI-OPT/src//module-info.java
OSGI-OPT/src/com/
OSGI-OPT/src/com/example/
OSGI-OPT/src/com/example/Main.java
OSGI-OPT/src/module-info.java
com/
com/example/
com/example/Main.class
module-info.class{noformat}
Here is the small Hello World example that can be used to reproduce the 
behavior:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>com.example</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>bundle</packaging>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>11</release>
          <source>11</source>
          <target>11</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>4.2.1</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <_sources>true</_sources>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
{code}
{code:java}
// src/main/java/module-info.java
module com.example {
 exports com.example;
}
{code}
{code:java}
// src/main/java/com/example/Main.java
package com.example;
public final class Main {
    public static void main(String... args) {
        System.out.println("Hello World");
    }
}
{code}



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

Reply via email to