1

I'm trying to embed the below jar (among others) in an OSGi bundle.

<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-xjc</artifactId>
    <version>2.1.13</version>
</dependency>

maven-bundle-plugin with the below settings errors with Classes found in the wrong directory: {1.0/com/sun/codemodel/util/Surrogate$Parser.class=com.sun.codemodel.util.Surrogate$Parser, ...many more of these...} because this jar has a bunch of class files as resources in a folder called 1.0 at the root of the jar, which throws it off. How do I get around this?

       <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>3.0.0</version>

            <configuration>
                <instructions>
                    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                    <Embed-Transitive>true</Embed-Transitive>
                    <Export-Package>a.single.package.i.want.to.export</Export-Package>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                </instructions>
            </configuration>
        </plugin>
guydog28
  • 1,307
  • 1
  • 11
  • 15

1 Answers1

0

I had the same issue. It appears that I had two conflicting versions in the pom.xml. By excluding one of the versions I could solve the issue.

<dependency>
    <groupId>uk.ac.ebi.chebi.webapps.chebiWS.client</groupId>
    <artifactId>chebiWS-client</artifactId>
    <version>2.2.2</version>
    <exclusions>
        <exclusion>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-tools</artifactId>
        </exclusion>
    </exclusions>
</dependency>
matthiaskoenig
  • 718
  • 6
  • 6