本文介绍了强制maven为maven中心使用HTTPS的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最近的sonatype启用了maven central以支持https() 。我现在已经将以下代码段添加到我的pom.xml中以强制在任何地方使用https:
Recently sonatype enabled maven central to support https (background information). I've now added the following snippet to my pom.xml to force using https everywhere:
<!-- force https -->
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
问题:
- 这还够吗?或者某个地方还会涉及http吗?
- 这是正确的做法吗?正如我读到的那样,我应该在settings.xml中执行此操作。但是其他人使用我的(开源)项目将不会使用安全连接。
更新
它看起来不够,例如程序集插件仍然使用HTTP:
It does not look sufficient as for e.g. the assembly plugin still HTTP is used:
[INFO] --- maven-assembly-plugin:2.4:single (make-assembly) @ graphhopper-web ---
Downloading: http://repo.maven.apache.org/maven2/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
推荐答案
这已在最新的maven 3.2.3中修复!请参阅!
This is already fixed in latest maven 3.2.3! See the changelogs!
所以安装maven 3.2.3并做'rm -rf~ / .m2 / repository / *'以获得更好的感觉;)
So install maven 3.2.3 and do 'rm -rf ~/.m2/repository/*' for a better feeling ;)
这篇关于强制maven为maven中心使用HTTPS的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!