bundles-osgi.wiring.package=com.mashape.unirest.http (version>=2.0.0)(!(版本>=3.0.0))



在对保险丝服务器进行一些更改后,我正在尝试在保险丝服务器上部署捆绑包。我添加了 unirest 依赖项来执行 REST 调用。

该构建在本地机器和 Jenkins 上运行良好,但捆绑包抛出错误并且未部署在 fuse 服务器上。

它抛出以下错误:

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)))

以下是我的绒球.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>

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

将其包含在构建>插件下。

<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>

最新更新