由于“需要 HTTPS”错误,我最近在构建项目时遇到了问题。这个问题解决了通过修改我的pom.xml所描述这里,添加以下:
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<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>
Run Code Online (Sandbox Code Playgroud)
但是,对于我拥有的每个项目,更新每个 pom.xml 很麻烦。
我曾尝试将相同的代码片段添加到我的 settings.xml 中,但无济于事。
我知道较新版本的 Maven 解决了这个问题。但是,由于工作限制,我无法更新我的环境。
我目前已经安装了 Netbeans 8.2 安装程序捆绑的 Java 8 和 Maven。
有什么我可以添加到我的 settings.xml 以避免修改我工作的每个 pom.xml 的东西吗?如果绝对必要,有没有办法可以只更新我的 Maven 版本,知道我已经安装了 Netbeans 的任何东西?
希望这不是重复的,我已经搜索了几个条目,但都无济于事。