日期:2014-05-16  浏览次数:20874 次

apache felix 4.0.3 + maven 3 + eclipse 4.2 配置, 开发, 运行, 调试

?

1.?新建一个?Maven?project,?如下图所示.

?

2.?修改?pom.xml?文件如下

?

<project?xmlns="http://maven.apache.org/POM/4.0.0"?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xsi:schemaLocation="http://maven.apache.org/POM/4.0.0?http://maven.apache.org/xsd/maven-4.0.0.xsd">

??<modelVersion>4.0.0</modelVersion>

??<groupId>cn.sia</groupId>

??<artifactId>FelixLauncher_4.0.3</artifactId>

??<version>4.0.3</version>

?

?

??<properties>

?

????<felix.bundlerepository.version>1.6.6</felix.bundlerepository.version>

????<felix.gogo.command.version>0.12.0</felix.gogo.command.version>

????<felix.gogo.shell.version>0.10.0</felix.gogo.shell.version>

????<felix.gogo.runtime.version>0.10.0</felix.gogo.runtime.version>

????

????<felix.framework.version>4.0.3</felix.framework.version>

????<org.osgi.compendium.version>4.2.0</org.osgi.compendium.version>

??</properties>

?

??<build>

??<!--删除?bundle?文件夹??-->

????<plugins>

??????<plugin>

????????<artifactId>maven-clean-plugin</artifactId>

????????<version>2.4.1</version>

????????<configuration>

??????????<filesets>

????????????<fileset>

??????????????<directory>bundle</directory>

????????????</fileset>

??????????</filesets>

????????</configuration>

??????</plugin>

??????

?<!--?往?bundle?里添加东西??-->

??????<plugin>

????????<groupId>org.apache.maven.plugins</groupId>

????????<artifactId>maven-dependency-plugin</artifactId>

????????<version>2.6</version>

????????<executions>

??????????<execution>

????????????<id>copy</id>

????????????<phase>generate-resources</phase>

????????????<goals>

??????????????<goal>copy</goal>

????????????</goals>

????????????<configuration>

??????????????<artifactItems>

??????????????

??????????????<!--?添加?gogo.command?-->

????????????????<artifactItem>

??????????????????<groupId>org.apache.felix</groupId>

??????????????????<artifactId>org.apache.felix.gogo.command</artifactId>

??????????????????<version>${felix.gogo.command.version}</version>

????????????????</artifactItem>

????????????????

????????????????<!--?添加?gogo.runtime?-->

????????????????<artifactItem>

????????????????