Hello - We've switched back to using jar as our packaging type as Jenkins
wasn't recognizing bundle. My question/problem is, when we generate the
manifest the autowire.xml is never included.
We're using these plugins:
<plugin>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>blueprint-maven-plugin</artifactId>
<configuration>
<scanPaths>
<scanPath><mypackage></scanPath>
</scanPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/OSGI-INF/blueprint</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/generated-resources/OSGI-INF/blueprint</directory>
<includes>
<include>autowire.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<useBlueprint>true</useBlueprint>
<Export-Package>!<mypackage>.*.api,
<mypackage>*;version=${project.version}</Export-Package>
<Import-Package>
org.apache.felix.service.command,
org.apache.felix.gogo.commands,
org.apache.karaf.shell.console,
org.apache.karaf.shell.commands,
javax.persistence;version="[1.0.0,2.1.0]",
<!-- Needed for
proxying's Javassist enhancement during runtime -->
!javax.transaction,
javax.transaction;version="[1.1,2)",
<!-- cxf/rest -->
javax.ws.rs.*;version="[1.1,4)",
org.apache.cxf.*;version="[2,4)",
org.apache.cxf.jaxrs.client,
*
</Import-Package>
</instructions>
</configuration>
</plugin>
What is generated by plugin:
Manifest-Version: 1.0
Bundle-Description: Report OSGi bundle project.
Bundle-SymbolicName: report
Archiver-Version: Plexus Archiver
Built-By: jpratt
Bnd-LastModified: 1456427904864
Bundle-ManifestVersion: 2
Import-Package: <myimports>
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-3.0.0.201509101326
Export-Package: <myexports>
Bundle-Name: WRS Report
Bundle-Version: 1.0.7
Bundle-Blueprint: OSGI-INF/blueprint/cxfReport.xml
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.8.0_66
The autowire.xml is not added to the bundle-blueprint section, why? What am I
doing wrong?
Kind regards,
Jason