0

我正在使用 Maven 项目,我正在尝试解决一些依赖问题cassandra-all_1.2.2。我正在使用Astyanax clientCassandra,只要我添加所有依赖项并启动我的服务器。我总是低于例外-

The package dependency org.apache.hadoop.util required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency com.sun.jna required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.mapreduce required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.io required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.impl.util required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.backend.hadoop.executionengine.mapReduceLayer required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.fs required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.avro.io with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.conf required by bundle [org.apache.cassandra.cassandra-thrift_1.2.2, org.apache.cassandra.cassandra-all_1.2.2] cannot be resolved.
The package dependency org.apache.avro with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.data required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.mapred required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.backend.executionengine required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.mindrot.jbcrypt required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.avro.specific with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
org.apache.aries.application.management.ResolverException: The system cannot provision the EBA goldenservice.eba.eba because the following problems in the dependency chain were detected: 
The package dependency org.apache.hadoop.util required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency com.sun.jna required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.mapreduce required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.io required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.impl.util required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.backend.hadoop.executionengine.mapReduceLayer required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.fs required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.avro.io with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.conf required by bundle [org.apache.cassandra.cassandra-thrift_1.2.2, org.apache.cassandra.cassandra-all_1.2.2] cannot be resolved.
The package dependency org.apache.avro with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.data required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.hadoop.mapred required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.pig.backend.executionengine required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.mindrot.jbcrypt required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.
The package dependency org.apache.avro.specific with the version greater than or equal to 1.4.0 required by bundle org.apache.cassandra.cassandra-all_1.2.2 cannot be resolved.

下面是我的pom.xml file

<?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.Host</groupId>
        <artifactId>HostParent</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>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.host.kernel</groupId>
            <artifactId>kernelMerged</artifactId>
        </dependency>
        <dependency>
            <groupId>com.host.bulls.shared</groupId>
            <artifactId>BullsShared</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax</artifactId>
            <version>1.56.37</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </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>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

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

        <repository>
            <id>Host.releases</id>
            <url>http://hostdomain/nexus/content/repositories/releases/</url>
            <releases />
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>releases</id>
            <url>http://hostdomain/content/repositories/releases/</url>
            <releases>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>thirdparty</id>
            <url>http://hostdomain/content/repositories/thirdparty/</url>
            <releases>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>host</id>
            <url>http://hostdomain.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>

有人可以帮我吗?我做错了什么吗?任何建议都将对解决此问题有很大帮助。我被这个问题困扰了很长时间,仍然无法找出根本原因。

4

1 回答 1

0

Under normal circumstances Maven should be able to resolve that dependencies from the central repositories. I am guessing your ~/.m2/settings.xml has a mirror configuration to proxy Maven central repository into a local company nexus server and those dependencies are missing (Nexus not updating maybe?).

Normally the solution for this is either:

  1. Get your Nexus admin to check and fix the mirroring problem if any
  2. Bypass your company nexus and go straight to the internet (Update your ~/.m2/settings.xml)
于 2013-05-29T04:32:29.233 回答