OSGi karaf-maven-plugin
karaf-maven-plugin
1. 配制 karaf 启动时加载 bundle
项目中需要在 karaf 中集成 cxf-dosgi-discovery-distributed 特性,所以需要在 karaf 开启时启动 cxf-dosgi-discovery-distributed 的 feature,只需要在 etc/org.apache.karaf.features.cfg 中加入如下的片段即可:
featuresRepositories=mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.apache.cxf.dosgi/cxf-dosgi/1.6.0/xml/features
featuresBoot=config,standard,region,package,kar,ssh,management,cxf-dosgi-discovery-distributed
其中:“mvn:org.apache.cxf.dosgi/cxf-dosgi/1.6.0/xml/features” 和 “cxf-dosgi-discovery-distributed” 为加入的部分。
上述配置以后,karaf 启动时就会从 maven 仓库下载所需要的 feature 并启动。
但是这样需要每次都从 maven 仓库中取,网络状况不好的时候很费时。最好的方式是把这些 feature 都放在本地。幸好 karaf 的 system 目录就是专干这个的。可以把 feature 相关的 bundle 都放在 system 中,这样就不再需要去 maven 仓库中取了。
2. karaf-maven-plugin 制作本地 feature 仓库
利用 karaf-maven-plugin 的 features-add-to-repository 即可实现:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>3.0.3</version>
<executions>
<execution>
<id>features-add-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>features-add-to-repository</goal>
</goals>
<configuration>
<descriptors>
<descriptor>mvn:org.apache.cxf.dosgi/cxf-dosgi/1.6.0/xml/features</descriptor>
<descriptor>mvn:org.apache.karaf.features/standard/3.0.3/xml/features</descriptor>
</descriptors>
<features>
<feature>http-whiteboard</feature>
<feature>cxf-dosgi-discovery-distributed</feature>
</features>
<repository>target/features-repo</repository>
</configuration>
</execution>
</executions>
</plugin>
生成的 maven 结构的目录会放在 target/features-repo 中,只需要把里面的目录原封不动拷贝到 karaf 的 system 目录下即可。下次启动时 feature 就会从这里面获取了。
OSGi karaf-maven-plugin的更多相关文章
- OSGi karaf scheduler
OSGi karaf scheduler karaf 中提供了定时任务管理,只需安装 feature:install scheduler 即可,然后在 karaf 容器中发布 org.apache.k ...
- 学习Maven之Cobertura Maven Plugin
cobertura-maven-plugin是个什么鬼? cobertura-maven-plugin是一个校验单元测试用例覆盖率的工具,可以生成一个测试覆盖率报告,可以给单元测试用例编写提供参考. ...
- Maven实现Web应用集成測试自己主动化 -- 部署自己主动化(WebTest Maven Plugin)
上篇:Maven实现Web应用集成測试自己主动化 -- 測试自己主动化(WebTest Maven Plugin) 之前介绍了怎样在maven中使用webtest插件实现web的集成測试,这里有个遗留 ...
- 解决Jetty Maven Plugin:Please initialize the log4j system properly(转)
解决Jetty Maven Plugin:Please initialize the log4j system properly.Jetty Maven Plugin环境: <plugin> ...
- Spring Boot Maven Plugin(二):run目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Spring Boot Maven Plugin(一):repackage目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
[背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...
- Error : Weblogic Maven Plugin deployment WebLogic 12c
Error : Weblogic Maven Plugin deployment i want to use weblogic-maven-plugin in my maven project in ...
- tomcat:run和tomcat7:run的区别,以及Apache Tomcat Maven Plugin 相关
起因: 同事部署的maven项目,之前使用 jetty,现在切换到 tomcat,但是他使用的命令是 tomcat:run ,而不是 tomcat7:run,能启动,但出现问题了. 于是搜索了一番,想 ...
- Versions maven plugin 修改版本
使用versions maven plugin插件,批量修改项目各模块的版本号,灵活推进或回退版本,避免主干每次更新代码,立即对所有分支产生影响. https://blog.csdn.net/sunz ...
随机推荐
- Python序列化和反序列化vsJSON
# -*- coding: utf-8 -* """没有嵌套类的类 author: Jill usage: """ import json ...
- 简单学习Git
Git是什么? Git是目前世界上最先进的分布式版本控制系统(没有之一). Git有什么特点?简单来说就是:高端大气上档次! Git的发展历史 很多人都知道,Linus在1991年创建了开源的Linu ...
- uva-185-暴力枚举
请相信,这是一道水题,读了一周的题意 题意: 题目里面描述的那三个条件可以直接无视,关于罗马数字只要知道一个规则即可,映射如下 I 1 V 5X 10 L 50C 100 D 50 ...
- js小效果:返回顶部 scrollTop 。 滚屏:animate
返回顶部: (scroll 滚屏事件,如果超出第一屏,显示返回顶部的按钮) <div id="gotop" onclick="javascript:scroll(0 ...
- 使用Apache POI处理excel公式不更新的解决办法
使用poi更新excel时,如果单元格A设置了公式,当其依赖的其他单元格填充了值之后,导出的excel中A仍为公式而不是自动计算的值,如图: Paste_Image.png 分值小计没有更新成计算结果 ...
- 前段开发-css-总结
应用参考https://www.cnblogs.com/alice-bj/p/8972299.html CSS:层叠样式表(Cascading Style Sheets) 1.css的特征 一.css ...
- event bManualResult
MSDN: bManualReset [in] If this parameter is TRUE, the function creates a manual-reset event object, ...
- 使用root用户,在centos7中安装rabbitMQ
参考地址: https://www.linuxidc.com/Linux/2018-01/150600.htm https://blog.csdn.net/summerhust/article/det ...
- asp.net cors solution
I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access ...
- layoutSubviews相关总结
ios layout机制相关方法 - (CGSize)sizeThatFits:(CGSize)size - (void)sizeToFit ------- - (void)layoutSubview ...