2016-05-29 138 views
0

我正在嘗試做一個休息Web服務示例。maven-compiler-plugin:3.1或其某個依賴關係無法解析

這是我的POM:

<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"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>my.group</groupId> 
    <artifactId>restService</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>restService</name> 
    <url>http://maven.apache.org</url> 

    <parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.3.5.RELEASE</version> 
    </parent> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency>   
    </dependencies> 

    <properties> 
     <java.version>1.7</java.version> 
    </properties> 


    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
    </build> 

    <repositories> 
     <repository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>spring-releases</id> 
      <url>https://repo.spring.io/libs-release</url> 
     </pluginRepository> 
    </pluginRepositories> 
</project> 

當我運行:

>mvn package 
[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building restService 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ restService --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory D:\Documents\Universita\tesi\javaWorkspace\restService\src\main\resources 
[INFO] skip non existing resourceDirectory D:\Documents\Universita\tesi\javaWorkspace\restService\src\main\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ restService --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.935 s 
[INFO] Finished at: 2016-05-29T17:05:52+02:00 
[INFO] Final Memory: 15M/185M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project restService: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-core:jar:2.0.9, log4j:log4j:jar:1.2.12: Failure to find org.apache.maven:maven-core:jar:2.0.9 in http://localhost:8081/artifactory/remote-repos was cached in the local repository, resolution will not be reattempted until the update interval of remote-repos has elapsed or updates are forced -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 

的問題似乎是artifactory的,並非解決依賴性。

我該怎麼辦?

感謝

+0

向我們展示你的settings.xml或無論你配置artifactory的。看起來你不能從Maven中心獲得東西。 – bmargulies

+0

與mvn -U軟件包解決......無論如何 – michele

回答

0

mvn -U package 解決了它artifactory的被迫下載文物

相關問題