目录
4.1新建一个Run/Debug 启动选择OSGI Bundles
1.准备工作
自己去官方下载,或者直接下载我第一篇文章中配置好的felix项目,自己下载的话比较麻烦,可能需要很多次进行尝试,包的版本不对,无法启动,懒得尝试或者想开箱即用的兄弟请移步到:
2.下载配置idea osgi插件
3.新建两个maven项目
需要源码的去我上面的连接去下载一下,在上面
felix-clinet bundle
package com.nxhz.felix.client;
import com.nxhz.felix.server.Hello;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
/**
* @author jierui
* @package PACKAGE_NAME
* @date 2022/7/13-9:33
* @description:
*/
public class ClientBundleActivator implements BundleActivator {
@Override
public void start(BundleContext ctx) throws Exception {
System.out.println("----------------hello client start---------------------"