带有Apache Felix插件的Maven Web项目 [英] Maven Web Project with Apache Felix Plugin

查看:122
本文介绍了带有Apache Felix插件的Maven Web项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 maven 创建简单的 osgi (部署到 virgo服务器)项目,用pom创建战争结构的最佳方法是什么? .xml Maven描述符?

What's the best way to create a simple osgi (deploying into virgo server) project using maven, to create a war structure with pom.xml maven descriptor?

结构目标是

*.jsp
*.html
META-INF
MANIFEST (OSGI-CONFIG)
WEB-INF
  classes
  lib
  web.xml

然后,当我创建一个项目时

Then when I create a project

这是我的pom.xml

This is my pom.xml

项目属性

<groupId>com.aaaa</groupId>
<artifactId>first-maven-virgo-project</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>

Felix插件

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <supportedProjectTypes>
            <supportedProjectType>war</supportedProjectType>
        </supportedProjectTypes>
        <instructions>
            <Export-Package>com.roshka.servlet</Export-Package>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Bundle-ClassPath>.,WEB-INF/classes,{maven-dependencies}</Bundle-ClassPath>
            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime;</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Web-ContextPath>/hello</Web-ContextPath>
            <Webapp-Context>hello</Webapp-Context>
        </instructions>
    </configuration>
</plugin>

但是,当我执行mvn install时,程序包不会创建MANIFEST文件,而是要打包到METAINF文件夹中.

But, when I execute mvn install the package does not create the MANIFEST file, to package into METAINF folder.

我的felix项目出了什么问题?创建OSGI BUNDLE和WAR OSGI BUNDLE的典型pom.xml模板是什么?

What's the wrong with my felix project? What's is the typical pom.xml template to create an OSGI BUNDLE , and WAR OSGI BUNDLE?

p.s.如果我将 War 更改为 Bundle 到Packaging Maven描述符中,则JAR生成的作品正常,而MANIFEST生成的作品正常.但这不是WEB结构.

p.s. if I change WAR TO BUNDLE into Packaging Maven descriptor, the JAR generated works OK, with MANIFEST generated OK. But it is not WEB Structure.

推荐答案

可以找到IBM的答案

There is an answer from IBM to be found here which describes the process step by step. A script could be developed to create a bundle given a war, I have written one in java, invoked as a build step.

一个关键的区别是IBM步骤将制成品留在罐子中,而jrey将其留作战争文件.这可能是因为IBM的步骤可能导致进一步的CICS捆绑,据我所知,至少在使用RAD环境时,这需要jar.

One crucial difference is that the IBM steps leave the finished product as a jar, whereas jrey leaves his as a war file. This is possibly because the IBM steps might lead to further CICS bundling, which requires jars as far as I am aware, at least when using the RAD environment.

这篇关于带有Apache Felix插件的Maven Web项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆