Eclipse / IntelliJ IDEA上的Maven安装

时间:2018-08-21 15:27:33

标签: java eclipse maven intellij-idea maven-2

使用maven设置Eclipse和IntelliJ时出错:

1)Eclipse ------->

a)错误1:

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not tran
sfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.7 from/to ce
ntral (https://repo.maven.apache.org/maven2): repo.maven.apache.org

b)错误2:

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be 
     resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Failure to transfer 
     org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be 
     reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-
     compiler-plugin:pom:3.1 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
    - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be 
     resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Could not transfer artifact 
     org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-
     testCompile, phase: test-compile)
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, 
     phase: compile)

2)IntelliJ错误------->

Failed to read Artifact descriptor 

...我已经在Windows上设置了Maven,并尝试从命令行进行编译,但出现错误:

3)MVN命令行错误------->

a)

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not tran
    sfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.7 from/to ce
    ntral (https://repo.maven.apache.org/maven2): repo.maven.apache.org

b)Caused by: java.net.UnknownHostException: repo.maven.apache.org

0 个答案:

没有答案