maven 创建spring dm工程

http://www.ops4j.org/projects/pax/construct/examples/spring-osgi.html该文章是pax-construct 插件创建spring dm 的入门实例。下载里面的windows中运行的script运行就可以创建一个helloworld。现在来简单的介绍一下这个脚本。
1)pax-create-project -g examples -a spring 创建一个名为spring的工程。具体命令介绍请看 上一篇文章maven创建osgi工程 http://zcmor.iteye.com/blog/1486563 。
2) cd spring 。进入spring 目录
3)设置spring dm 相关包的maven仓库地址 pax-add-repository -i com.springsource.repository.bundles.external -u http://repository.springsource.com/maven/bundles/external
4)导入spring dm 的bundle。 pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.1.2 -- -DimportTransitive -DwidenScope
5) 创建bundle。 pax-create-bundle -p org.example.service -- -Djunit
6)创建一个bundle pax-create-bundle -p org.example.service -- -Djunit
7) 创建一个spring bean pax-create-bundle -p org.example.bean -- -Dspring -Djunit
8) 用equinox 代替默认的felix。 mvn clean install pax:provision "-Dframework=equinox"

[color=red] 在运行时可能会报 Failed to load class "org.slf4j.impl.StaticLoggerBinder". pax错误。这是slf4j包版本不对导致,解决办法是将spring\provision 下面的pom文件中slf4j的版本改为1.6.0即可。[/color]
[color=red]如果运行中报Missing Constraint: Import-Package: org.apache.commons.logging; version="0.0.0"错误,解决办法是将apache的common log bundle选上。[/color]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值