Java 在Eclipse/IntelliJ IDEA上的Maven设置

Java 在Eclipse/IntelliJ IDEA上的Maven设置,java,eclipse,maven,intellij-idea,maven-2,Java,Eclipse,Maven,Intellij Idea,Maven 2,使用maven设置Eclipse和IntelliJ时出错: 1) 月食-------> a) 错误1: b) 错误2: 2) IntelliJ错误-------> 。。。我在Windows上安装了Maven,并尝试从命令行编译,但出现错误: 3) MVN命令行错误-------> (a) b) 由以下原因引起:java.net.UnknownHostException:repo.maven.apache.org您是否在防火墙后尝试此操作?检查并确保没有任何东西阻止您访问repo.maven.ap

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

1) 月食------->

a) 错误1:

b) 错误2:

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

。。。我在Windows上安装了Maven,并尝试从命令行编译,但出现错误:

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

(a)


b)
由以下原因引起:java.net.UnknownHostException:repo.maven.apache.org

您是否在防火墙后尝试此操作?检查并确保没有任何东西阻止您访问repo.maven.apache.org是的,我在防火墙后面,并在IntelliJ IDEA中添加了代理,通过测试表明它是成功的。对于MAVEN POM.xml文件中的每个依赖项,我都会遇到这样的错误:无法读取工件描述符您是否为http和https设置了代理?如何测试连接?在INTELLIJ IDEA-->设置-->HTTP代理中,我选择了-Manual PROXY Configuration-HTTP(非SOCKS),请后退一步,尝试
ping repo.maven.apache.org
并查看是否有响应。如果没有,请在计算机中设置代理设置。如果你的工作场所提供了autoproxy,请使用它。
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
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)
Failed to read Artifact descriptor 
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