gpt4 book ai didi

java - bundle 中 Unresolved 约束-osgi.wiring.package=com.mashape.unirest.http (版本>=2.0.0)(!(版本>=3.0.0))

转载 作者:太空宇宙 更新时间:2023-11-04 09:25:07 25 4
gpt4 key购买 nike

我正在尝试在 fuse 服务器上进行一些更改后在其上部署 bundle 。我添加了 unirest 依赖项来执行 REST 调用。

构建在本地计算机和 Jenkins 上运行良好,但 bundle 抛出错误并且未部署在熔断服务器上。

它抛出以下错误:

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>

最佳答案

在我的 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>

关于java - bundle 中 Unresolved 约束-osgi.wiring.package=com.mashape.unirest.http (版本>=2.0.0)(!(版本>=3.0.0)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57800815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com