public interface GreetingService { void sayHello(); } @Component public class GreetingServiceImpl implements GreetingService { @Override public void sayHello() { System.out.println("Hello, OSGi!"); } } ... <dependencies> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> <version>1.4.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.scr.annotations</artifactId> <version>1.9.6</version> </dependency> </dependencies> ... Bundle-SymbolicName: com.example.greeting Bundle-Name: Greeting Service Bundle-Version: 1.0.0 Service-Component: OSGI-INF/*.xml


上一篇:
下一篇:
切换中文