gpt4 book ai didi

java - 无法解析包依赖 org.codehaus.jettison.json

转载 作者:行者123 更新时间:2023-12-01 23:47:35 32 4
gpt4 key购买 nike

谁能解释一下下面的错误是什么意思?我该如何解决它?

The package dependency org.codehaus.jettison.json with the version greater than or equal to 1.3.0 required by bundle com.hosyt.astyanax.astyanax_1.0.13 cannot be resolved.

我正在使用 Maven 并将 Astyanax 客户端与 Cassandra 结合使用。

下面是我的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/xsd/maven-4.0.0.xsd">

<!-- 1. Parent POM information Most of shared sections/configurations between
projects are inherited from parent pom. The shared sections are distributionManagement,
repositories, pluginRepositories, PluginManagement, Plugins 2. Switch this
to the project-specific aggregator pom -->
<parent>
<groupId>com.host.raptor</groupId>
<artifactId>RaptorParent</artifactId>
<version>1.6.0-RELEASE</version>
</parent>

<!-- POM Information about the Project -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.host.bulls.integ</groupId>
<artifactId>BullsDAO</artifactId>
<version>2.0.1-SNAPSHOT</version>
<!-- Packing Type is bundle for OSGI Library Bundle -->
<packaging>bundle</packaging>

<dependencies>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.host.astyanax</groupId>
<artifactId>astyanax</artifactId>
<version>1.0.13</version>
<exclusions>
<exclusion>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.host.bulls.shared</groupId>
<artifactId>BullsShared</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>

<!-- Build Configration -->
<build>
<plugins>
<!-- Apache Felix Bundle Plugin - For Generation of Manifest after Compile
phase -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<!-- Configuration for generating the Manifest.mf -->
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<!-- Configuration for generating the Manifest.mf -->
<configuration>
<manifestLocation>src/main/resources/META-INF</manifestLocation>
<!-- Manifest Headers which need to customized during manifest generation -->
<instructions>
<Bundle-SymbolicName>com.host.bulls.integ.BullsDAO</Bundle-SymbolicName>
<!-- <Export-Package></Export-Package> -->
<Import-Package>*,
org.springframework.beans.factory;version="[3.0.5.RELEASE,4.0.0)",
org.springframework.beans.factory.config;version="[3.0.5.RELEASE,4.0.0)",
net.sf.cglib.core;version="[2.1.3,3.0.0)",
net.sf.cglib.proxy;version="[2.1.3,3.0.0)",
net.sf.cglib.reflect;version="[2.1.3,3.0.0)"
</Import-Package>
<!-- <X-Raptor-Pipeline-Handler></X-Raptor-Pipeline-Handler> -->
<!-- <X-Raptor-Initializer></X-Raptor-Initializer> -->
</instructions>
</configuration>
</plugin>
</plugins>
</build>

<!-- Configuration of repositories for dependency resolution -->
<repositories>
<!-- Raptor Bundles Repository -->
<!-- This is needed to locate the Raptor Parent project. Other repositories
come from the parent. -->

<repository>
<id>raptor.releases</id>
<url>http://nxraptor/nexus/content/repositories/releases/</url>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>releases</id>
<url>http://nxraptor/content/repositories/releases/</url>
<releases>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>thirdparty</id>
<url>http://nxraptor/content/repositories/thirdparty/</url>
<releases>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>host</id>
<url>http://nxraptor.qa.host.com/content/repositories/thirdparty/</url>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<name>Maven Central Repo</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>riptano</id>
<name>riptano</name>
<url>http://mvn.riptano.com/content/repositories/public</url>
</repository>
</repositories>
</project>

最佳答案

这意味着 com.hosyt.astyanax.astyanax_1.0.13 依赖于 org.codehaus.jettison:jettison 版本 1.3.0 或更高版本,但未找到。您的 pom 包含版本 1.3,但 Maven 确定 1.3 早于 1.3.0。尝试将其更改为

<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.1</version>
</dependency>

(假设您的项目兼容1.3.1)

关于java - 无法解析包依赖 org.codehaus.jettison.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16804202/

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