The last thing that's left is to declare the bundle activator to be added to the bundle manifest. You also need to declare the package com.packtpub.felix.bookshelf.inventory.impl.mock.activator
as a private package, so that it is made available for the bundle at runtime, but not visible to other bundles.
Edit the maven-bundle-plugin
configuration instructions in the POM build plugins section and add the Bundle-Activator
tag (in bold below). It holds the name of the bundle activator class.
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-Category>sample</Bundle-Category> <Bundle-SymbolicName> ${artifactId}</Bundle-SymbolicName> <Bundle-Activator> com.packtpub.felix.bookshelf.inventory.impl.mock.activator.- BookInventoryMockImplActivator </Bundle-Activator> <Export-Package> com.packtpub.felix.bookshelf.inventory.impl.mock </Export-Package> <Private-Package> com.packtpub.felix.bookshelf.inventory.impl.mock.activator </Private-Package> </instructions> <obrRepository>file:/P:/projects/felixbook/dev </obrRepository> </configuration> </plugin> </plugins>
That's it!