2016-03-02 81 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