bundles-osgi.wiring.package = com.mashape.unirest.http中未解决的约束(版本> = 2.0.0)(!(版本> = 3.0.0))

时间:2019-09-05 07:51:40

标签: java maven osgi fuse unirest

我在对保险丝服务器进行少量更改后尝试将其部署在保险丝服务器上。我添加了unirest依赖性来执行REST调用。

该构建在本地计算机和Jenkins上运行正常,但是捆绑包抛出错误并且没有部署在保险丝服务器上。

它抛出以下错误:

Unable to start bundle 3716: 
  unresolved constraint in bundle com.......component.sharepoint [3716] :
   unable to resolve 3761.0 :
     missing  requirment (3761.0 ) (&(osgi.wiring.package;(&(osgi.wiring.package=com.mashape.unirest.http)(version>=2.0.0)(!(version>=3.0.0)))

下面是我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>******confidential****</groupId>
        <artifactId>parent</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <relativePath>../parent</relativePath>
    </parent>

    <artifactId>sharepoint</artifactId>
    <packaging>bundle</packaging>

    <name>Fuse : Component : SharePoint</name>
    <url>******</url>

    <dependencies>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons.coded.version}</version>
        </dependency>

        <dependency>
            <groupId>***************</groupId>
            <artifactId>vendorcache</artifactId>
            <version>${vendorcache.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>

        <dependency>
            <groupId>com.mashape.unirest</groupId>
            <artifactId>unirest-java</artifactId>
            <version>1.4.9</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.parent.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.parent.groupId}.${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            ${project.parent.groupId}.${project.artifactId}.*
                        </Export-Package>
                        <Import-Package>*</Import-Package>
                        <Embed-Dependency>com.mashape.unirest;scope=compile|runtime;inline=true</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

1 个答案:

答案 0 :(得分:0)

在我的pom.xml中添加以下内容对我有用:

将其包含在build-> plugins中。

 <plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <instructions>
        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
        <Import-Package>*</Import-Package>
      </instructions>
    </configuration>
  </plugin>