Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache Maven捆绑包包装问题,称为MNG-4338_Apache_Maven_Bundle_Packaging - Fatal编程技术网

Apache Maven捆绑包包装问题,称为MNG-4338

Apache Maven捆绑包包装问题,称为MNG-4338,apache,maven,bundle,packaging,Apache,Maven,Bundle,Packaging,maven bundle插件有问题: 我想将我的项目部署为osgi捆绑包,因此我使用打包作为捆绑包。 但pom似乎不知道包装是捆绑的。在这里您可以看到my pom.xml: <project ...>... <packaging>bundle</packaging> <version>1.0.0</version> <name>Simple CXF project using spring configuratio

maven bundle插件有问题:

我想将我的项目部署为osgi捆绑包,因此我使用打包作为捆绑包。 但pom似乎不知道包装是捆绑的。在这里您可以看到my pom.xml:

<project ...>...
    <packaging>bundle</packaging>
<version>1.0.0</version>

<name>Simple CXF project using spring configuration</name>

<properties>
    <cxf-version>2.4.2</cxf-version>
</properties>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <version>2.3.5</version>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Export-Package>demo.hw.server</Export-Package>
                        <Bundle-Activator>demo.hw.server.Activator</Bundle-Activator>
                        <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<dependencies>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf-version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf-version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>1.4.0</version>
    </dependency>
</dependencies>

</project>
致以最良好的祝愿,
saen

鉴于上面的pom示例,您应该将maven bundle插件移到
节点之外<代码>通常用于父POM中的继承目的。捆绑包包装类型由maven捆绑包插件提供(这就是为什么需要
true
),因此在这种情况下,该插件必须位于
之外

<project ...>...
    <packaging>bundle</packaging>
    <version>1.0.0</version>

    <name>Simple CXF project using spring configuration</name>

    <properties>
        <cxf-version>2.4.2</cxf-version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <version>2.3.5</version>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Export-Package>demo.hw.server</Export-Package>
                        <Bundle-Activator>demo.hw.server.Activator</Bundle-Activator>
                        <Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>1.4.0</version>
        </dependency>
    </dependencies>

</project>
。。。
捆
1.0.0
使用spring配置的简单CXF项目
2.4.2
org.apache.maven.plugins
maven编译器插件
1.5
1.5
org.apache.felix
maven捆绑插件
真的
2.3.5
${project.groupId}.${project.artifactId}
${project.name}
${project.version}
demo.hw.server
demo.hw.server.Activator
org.apache.cxf.bundle
org.apache.cxf
cxf rt前端jaxws
${cxf版本}
org.apache.cxf
cxf rt传输http
${cxf版本}
org.apache.felix
org.osgi.core
1.4.0

我看到了类似的问题。我突然想到,当组id结束时,就像工件id开始时一样。我试着捆绑这样的东西:

<groupId>org.slf4j</groupId>
<artifactId>slf4j-api.plugin</artifactId>
org.slf4j
slf4j-api.plugin

工件id中的slf4j被删除,结果是:清单中的org.slf4j.api.plugin作为符号名。

是的,问题是org.apache.felix需要在外部。

有类似的问题;我错过了真正的一点。谢谢
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api.plugin</artifactId>