2014-11-08 97 views
1

我使用Maven構建Hadoop項目。我對着下面的錯誤使用Maven構建Hadoop時出錯

[錯誤]未能就項目Hadoop的minikdc執行目標:無法解析項目org.apache.hadoop依賴關係:Hadoop的minikdc中:jar:3.0.0-快照:失敗查找org.apache.directory.jdbm:將apacheds-jdbm1:bundle:2.0.0-M2中的https://repo.maven.apache.org/maven2緩存在本地存儲庫中,直到中央的更新間隔已過或更新被強制爲止,分辨率纔會重新嘗試。

pom.xml

<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"> 
    <parent> 
<groupId>org.apache.hadoop</groupId> 
<artifactId>hadoop-project</artifactId> 
<version>3.0.0-SNAPSHOT</version> 
<relativePath>../../hadoop-project</relativePath> 
    </parent> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.apache.hadoop</groupId> 
    <artifactId>hadoop-minikdc</artifactId> 
    <version>3.0.0-SNAPSHOT</version> 
    <description>Apache Hadoop MiniKDC</description> 
    <name>Apache Hadoop MiniKDC</name> 
    <packaging>jar</packaging> 
<dependencies> 
<dependency> 
    <groupId>commons-io</groupId> 
    <artifactId>commons-io</artifactId> 
    <scope>compile</scope> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-core-api</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-interceptor-kerberos</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-protocol-shared</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-protocol-kerberos</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-ldif-partition</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-mavibot-partition</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.api</groupId> 
    <artifactId>api-all</artifactId> 
    <version>1.0.0-M20</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>xml-apis</groupId> 
     <artifactId>xml-apis</artifactId> 
    </exclusion> 
    <exclusion> 
     <groupId>xpp3</groupId> 
     <artifactId>xpp3</artifactId> 
    </exclusion> 
    <exclusion> 
     <groupId>dom4j</groupId> 
     <artifactId>dom4j</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-jdbm-partition</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.apache.directory.server</groupId> 
    <artifactId>apacheds-protocol-ldap</artifactId> 
    <version>2.0.0-M15</version> 
    <scope>compile</scope> 
    <exclusions> 
    <exclusion> 
     <groupId>org.apache.directory.api</groupId> 
     <artifactId>api-ldap-schema-data</artifactId> 
    </exclusion> 
    </exclusions> 
</dependency> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-log4j12</artifactId> 
    <scope>compile</scope> 
</dependency> 
<dependency> 
    <groupId>junit</groupId> 
    <artifactId>junit</artifactId> 
    <scope>compile</scope> 
</dependency> 
</dependencies> 
</project> 

誰能幫我嗎?

+0

請發表你的pom.xml,而且由於錯誤說,你正在尋找的依賴是不是有在指定的URL位置。 – zerocool 2014-11-08 16:59:12

+0

我已經粘貼了pom.xml。請讓我知道是什麼問題 – Jigar 2014-11-08 17:33:10

+0

重複的問題,請參閱:[http://stackoverflow.com/questions/9932923/why-cant-maven-find-an-osgi-bundle-dependency?lq=1](http: //stackoverflow.com/questions/9932923/why-cant-maven-find-an-osgi-bundle-dependency?lq=1)這個問題也被稱爲bug:[https://issues.apache.org/ JIRA /瀏覽/ HADOOP-12839](https://issues.apache.org/jira/browse/HADOOP-12839) – vtslab 2016-11-02 08:46:33

回答

0

這與Maven用於更新本地存儲庫中依賴關係的update policy相關。一種解決方案是嘗試手動刪除包含本地回購中依賴項org.apache.directory.jdbm:apacheds-jdbm1:bundle:2.0.0-M2的目錄,然後重新啓動構建。

您還可以強制通過傳遞-U到Maven的更新所有的依賴關係,如:

mvn clean install -U

0

如果這種依賴性是私有的,你需要給你Maven的設置文件在〜/ .m2目錄下添加相關信息/settings.xml

0

從你的聲明中,你說你無法解決項目org.apache.hadoop的依賴關係:hadoop-minikdc:jar:3.0.0-SNAPSHOT。好吧,我認爲這是你的maven的代理,你不能下載這個jar。請檢查你的代理,並再次。請轉到目錄。 〜/ .m2/settings.xml來修復你的設置。

這樣

<proxy> 
    <id>optional</id> 
    <active>true</active> 
    <protocol>http</protocol> 
    <username></username> 
    <password></password> 
    <host>child-prc.intel.com</host> 
    <port>913</port> 
    <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
</proxy>