2016-03-02 86 views
0

我正在逐個處理我的錯誤。開始得到使用Maven一握,但現在我對這個錯誤有點卡住:即使在安裝依賴Maven之後仍缺少pom artifact

Failed to execute goal on project services: Could not resolve dependencies for project eu.billfold:services:pom:1.0-SNAPSHOT: Failed to collect dependencies at eu.sdk:sdk:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for eu.sdk:sdk:jar:1.0-SNAPSHOT: Failure to find eu.billfold.myproject:root:pom:1.0-SNAPSHOT in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of java.net has elapsed or updates are forced

我最近在清理我與本地安裝的目標「SDK-1.0-SNAPSHOT.jar」所有錯誤「 mvn install「命令。當試圖安裝一個新的Maven版本時,它似乎無法按需要找到它。

我檢查我的本地的.m2回購和目標JAR確實是有在此路徑:

.m2目錄>資料庫> EU> SDK> SDK> 1.0-SNAPSHOT> SDK-1.0-SNAPSHOT.jar

這裏是POM扶養:

<?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> 
    <packaging>pom</packaging> 

    <parent> 
     <groupId>eu.billfold</groupId> 
     <artifactId>root</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </parent> 

    <artifactId>services</artifactId> 
    <name>${project.groupId}:${project.artifactId}</name> 

    <modules> 
     <module>support</module> 
     <module>account</module> 
     <module>bo-user</module> 
     <module>campaigns</module> 
     <module>currency</module> 
     <!--<module>geolocation</module>--> 
     <module>report</module> 
     <module>payment</module> 
     <module>mail-service</module> 
    </modules> 

    <dependencies> 

     <dependency> 
      <groupId>eu.sdk</groupId> 
      <artifactId>sdk</artifactId> 
      <version>${project.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>eu.sdk</groupId> 
      <artifactId>test-sdk</artifactId> 
      <version>${project.version}</version> 
      <scope>test</scope> 
     </dependency> 

     <!-- from: junit-bom --> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <!-- from: easymock-bom --> 
     <dependency> 
      <groupId>org.easymock</groupId> 
      <artifactId>easymock</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.easymock</groupId> 
      <artifactId>easymockclassextension</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <!-- from: spring3-bom --> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <!-- from: mockito-bom --> 
     <dependency> 
      <groupId>org.mockito</groupId> 
      <artifactId>mockito-all</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <!-- from: slf4j-bom --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>jcl-over-slf4j</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>jul-to-slf4j</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>log4j-over-slf4j</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>ch.qos.logback</groupId> 
      <artifactId>logback-classic</artifactId> 
     </dependency> 
    </dependencies> 

    <dependencyManagement> 
     <dependencies> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>easymock-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>junit-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>spring3-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>slf4j-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>mockito-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>hibernate-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>commons-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>mysql-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>javaassist-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>aspectj-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>ehcache-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>javax-apis-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>apache-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>spring-security3-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 

      <dependency> 
       <groupId>eu.boms</groupId> 
       <artifactId>geoip-bom</artifactId> 
       <version>${project.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

</project> 

任何想法是怎麼回事錯在這裏?我有點難住?

+2

好吧。是'$ {project.version} = 1.0-SNAPSHOT'嗎? – Tunaki

+0

是:母元素中的1.0-SNAPSHOT。我相信這應該糾正? – Beloudest

+0

不完全。你能發佈你的POM嗎? – Tunaki

回答

0

正如對問題的評論中所建議的,我在mv install命令中忽略了-U。我之前確實有一個依賴項問題,但我無法檢查它是否在沒有此命令的情況下被修復。

mvn -U clean install 
0

您的問題可能有幾個原因。 無論如何,我注意到:「找不到eu.billfold.myproject:root:pom:1.0-SNAPSHOT」。它指的是你的父項目:如果父母(你的項目的根目錄)未建

<parent> 
    <groupId>eu.billfold</groupId> 
    <artifactId>root</artifactId> 
    <version>1.0-SNAPSHOT</version> 
</parent> 

Maven依賴分辨率將無法正常工作。 請使用「mvn install」構建您的父項目,然後重試構建您的項目eu.billfold:services。

+0

謝謝我很愚蠢地錯過了這個mvn -U clean install – Beloudest