【发布时间】:2015-07-13 09:31:02
【问题描述】:
我目前正在将maven 托管捆绑包部署到felix 框架中,我想为部署过程创建一个maven 项目,并希望使用maven 插件自动化所有过程。
使用maven-dependency-plugin,我们可以以某种方式自动化部署过程。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack-felix</id>
<phase>compile</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>org.apache.felix.ipojo.distribution.quickstart</includeArtifactIds>
<outputDirectory>${project.build.directory}/tmp</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-bundles</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>
sample.maven.bundle1,
sample.maven.bundle2,
.
.
sample.maven.bundleN
</includeArtifactIds>
<outputDirectory>${project.build.directory}/bundle</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
但是<includeArtifactIds> 中提到的所有捆绑包都是静态的,使用bundle:update 或felix:update 更新它们可能会遇到问题。
如何将捆绑包部署到felix 或karaf,就像在felix 中运行felix:deploy 一样,但使用maven 调用?
【问题讨论】:
标签: java maven apache-felix apache-karaf