java编译的时候经常会遇到类似下面的一些问题:
[ERROR] Failed to execute goal on project apache-atlas: Could not resolve dependencies for project org.apache.atlas:apache-atlas:pom:2.0.0: Failed to collect dependencies at org.slf4j:slf4j-api:jar:1.7.21: Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.7.21: Could not transfer artifact org.slf4j:slf4j-api:pom:1.7.21 from/to central (http://repo1.maven.org/maven2): Failed to transfer file: http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
其实主要都是镜像源问题,如果是linux环境,修改/etc/maven/settings.xml文件,添加
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
如果不行,再试试其他镜像。