2017-09-30 187 views
0

第一次在eclipse luna上设置maven项目,我在pom.xml文件中得到了以下错误。我做了很多谷歌解决问题,但无法解决错误。安装Maven项目时出错

错误:

故障转移org.apache.maven:Maven的归档:POM:2.6从https://repo.maven.apache.org/maven2在本地 库被缓存,分辨率将不会被重新尝试,直到中央的更新间隔已过或更新被强制。原始错误:无法 转移工件org.apache.maven:行家存档器:POM:2.6从/向中央(https://repo.maven.apache.org/maven2): repo.maven.apache.org

http://maven.apache.org /xsd/maven-4.0.0.xsd“> 4.0.0 VPP,植物配置设计 VPP,植物配置设计 0.0.1-SNAPSHOT VPP植物配置设计 org.springframework.boot spring-boot-starter-parent 1.4.0.RELEASE

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <java.version>1.7</java.version> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>9.3-1100-jdbc41</version> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.27</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-jdbc</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-jersey</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-lang3</artifactId> 
     <version>3.5</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.poi</groupId> 
     <artifactId>poi</artifactId> 
     <version>3.10-FINAL</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.poi</groupId> 
     <artifactId>poi-ooxml</artifactId> 
     <version>3.9</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/org.json/json --> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     </dependency> 

    <!-- <dependency> <groupId>ojdbc</groupId> <artifactId>ojdbc</artifactId> <version>14</version> </dependency> --> 
    <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> --> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>commons-dbcp</groupId> 
     <artifactId>commons-dbcp</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security.oauth</groupId> 
     <artifactId>spring-security-oauth2</artifactId> 
    </dependency> 
      <dependency> 
     <groupId>commons-collections</groupId> 
     <artifactId>commons-collections</artifactId> 
    </dependency> 
      <dependency> 
     <groupId>org.projectlombok</groupId> 
     <artifactId>lombok</artifactId>   
    </dependency> 
    <dependency> 
     <groupId>jfree</groupId> 
     <artifactId>jcommon</artifactId> 
     <version>1.0.0</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>5.1.0.Final</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-validator</artifactId> 
    <version>5.2.4.Final</version> 
    <scope>provided</scope> 
    </dependency> 
    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-entitymanager</artifactId> 
    <version>5.1.0.Final</version> 
    </dependency> 
    <dependency> 
    <groupId>net.sf.dozer</groupId> 
    <artifactId>dozer</artifactId> 
    <version>5.5.1</version> 
    </dependency> 

</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <configuration> 
       <excludes> 
        <exclude> 
         <groupId>org.projectlombok</groupId> 
         <artifactId>lombok</artifactId> 
        </exclude> 
       </excludes> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

+0

尝试强制更新,而您连接到互联网。请参阅https://stackoverflow.com/questions/4701532/force-maven-update以获取更多信息。 – blafasel

+0

最好是删除目录'$ HOME/.m2/repository/org/apache',然后在命令行上重建... – khmarbaise

回答

0

这是因为你有Maven的默认存储库配置从仓库每天一次更新的文物。

为了解决这个问题,你有两个选择:

  1. 力行家使用-U选项在Maven构建命令来更新
  2. 删除依赖关系的目录,然后再次运行此命令,

最后但并非最不重要的是,您可以更改存储库的updatePolicy。看看Maven Repositories doc