通过pax-construct创建osgi项目

 

pax项目,是集成osgi的绑定和工具的集合,construct子项目用于快速创建、构建、管理和部署各种类型的绑定。网址:

http://www.ops4j.org/projects/pax/construct/


要求

需要:

  1. JRE 1.4以上
  2. maven2

安装和配置

解压缩,设置环境变量(windows):

set PATH=C:\Temp\pax-construct-1.4\bin;%PATH%

使用

创建一个新的osgi项目:

pax-create-project -g com.easymorse.marshal -a helloworld

pax借助maven,-g examples表示groupId,-a test表示artifectId,并创建同名目录。

在新建项目中创建自己的绑定,命令行到项目目录下:

pax-create-bundle -p com.easymorse.marshal -n helloword.bundle
构建并部署到felix下:
mvn clean install pax:provision
创建eclipse项目供导入:
mvn pax:eclipse -DdownloadSources

最后,导入到eclipse(File -> Import -> Existing project…)。注意:需要设置M2_REPO classpath variables,否则有报错,另外,不可使用m2eclipse,否则加载重复的类库。

 
PDF格式創作    发送文章为PDF   

这篇文章上的评论的 RSS feed TrackBack URI

Leave a Reply