当前位置: 首页 > 知识库问答 >
问题:

已安装到传输http://repo.maven.apache.org/maven2-错误代码501,需要HTTPS[重复]

刘永望
2023-03-14
Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: 
Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): 
Failed to transfer http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom. Error code 501, HTTPS Required 
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <compilerArgument>-Xlint:all</compilerArgument>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>

既得。删除.m2,maven clean,...

我需要改变什么?

共有1个答案

林博厚
2023-03-14

我相信错误就像它说的那样:它不支持未加密的请求。所以我们应该把你的URL更改为HTTPS。

https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

如果由于某种原因不能使用HTTPS,请使用:

http://insecure.repo1.maven.org/maven2/

对于Maven Repos。

<repositories>
  <repository>
    <id>central</id>
    <name>Central Repository</name>
    <url>https://repo.maven.apache.org/maven2</url>
    <layout>default</layout>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>
 类似资料: