Hi,

I am new to OSGi and I am trying to add OSGi metadata to a .jar using Maven. I have seen the 'Adding OSGi metadata to existing projects without changing the packaging type' section at http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html, that is:

<plugin>
 <artifactId>maven-jar-plugin</artifactId>
 <configuration>
<archive> <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId>
 <artifactId>maven-bundle-plugin</artifactId>
 <executions>
   <execution>
     <id>bundle-manifest</id>
     <phase>process-classes</phase>
<goals> <goal>manifest</goal> </goals> </execution>
 </executions>
</plugin>

My .jar contains a MyAPIService public abstract class, and a MyServiceImpl class implementing MyAPIService. It also contains a MyServiceActivator extending org.osgi.framework.BundleActivator.

I have two questions:

i) The documentation does not mention configuration of the maven plugin to specify what my activator is, or what should be exported, imported, etc... Is this a necessary step in my case? If yes, how should I proceed? My service does not have dependencies on other services.

ii) My situation is simple, but what if I have two activators for two services in the same .jar? Will the plugins mentioned above automatically detect this and populate the MANIFEST properly? Is this good practice to put two (or more) services in the same .jar? Should I separate them?

Thanks,

JVersty






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to