SCA, Newton and Spring DM
Pom Files
- Change the three projects to bundle packaging : adding <packaging>bundle</packaging> to pom headers.
- Api will export com.jtunisie.osgi.sca package
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>com.jtunisie.osgi.sca</Export-Package>
<Bundle-SymbolicName>${pom.name}-${pom.version}</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- impl will also export com.jtunisie.osgi.sca package and make implementation private
<build>
<plugins>
<plugin>
<groupid>org.apache.felix</groupid>
<artifactid>maven-bundle-plugin</artifactid>
<extensions>true</extensions>
<configuration>
<instructions>
<export-package>com.jtunisie.osgi.sca</export-package>
<private-package>com.jtunisie.osgi.sca.impl</private-package>
<bundle-symbolicname>${pom.name}-${pom.version}</bundle-symbolicname>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- The client bundle doesn't export any package :
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Private-Package>com.jtunisie.osgi.sca.client</Private-Package>
<Bundle-SymbolicName>${pom.name}-${pom.version}</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- Add Newton headers : Installable-Component-Templates is the name of the composite file under resources|-- META-INF|-- newton directory.
- Impl pom :
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>com.jtunisie.osgi.sca</Export-Package>
<Private-Package>com.jtunisie.osgi.sca.impl</Private-Package>
<Bundle-SymbolicName>${pom.name}-${pom.version}</Bundle-SymbolicName>
<Installable-Component>true</Installable-Component>
<Installable-Component-Templates>META-INF/newton/service.composite</Installable-Component-Templates>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- client pom :
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Private-Package>com.jtunisie.osgi.sca.client</Private-Package>
<Bundle-SymbolicName>${pom.name}-${pom.version}</Bundle-SymbolicName>
<Installable-Component>true</Installable-Component>
<Installable-Component-Templates>META-INF/newton/client.composite</Installable-Component-Templates>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- client pom :
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)





Comments
Wassim ABID replied on Wed, 2009/02/04 - 11:48am