Maven:在pom.xml中设置settings.xml的位置吗? [英] Maven: Set the settings.xml location in the pom.xml?

查看:515
本文介绍了Maven:在pom.xml中设置settings.xml的位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在pom.xml文件中设置settings.xml文件的位置.

Is it possible to set the location of the settings.xml file inside the pom.xml file.

我知道您可以通过在命令行中输入mvn -s location/of/settings.xml来做到这一点,但是我想知道是否可以在pom.xml中进行设置,这样我就不必继续通过命令行进行输入了.

I know you can do it from the command line typing mvn -s location/of/settings.xml, but I wanted to know if I can set that within the pom.xml so I don't have to keep typing through command line.

推荐答案

否.从安全的角度来看,这可能是一个可怕的想法.它将允许pom的创建者绕过所有的settings.xml设置.如果您执行mvn -s location/of/settings.xml,您至少会知道它发生了.但是,如果您只是随机构建一个项目,谁会知道该项目的创建者是多么的恶意.

No. And that's probably a horrible idea, from a security standpoint. It'd allow the creator of a pom to bypass all your settings.xml settings. If you do the mvn -s location/of/settings.xml you will at least know it happened. But if you just randomly build a project, who knows how malicious that project's creator was.

这篇关于Maven:在pom.xml中设置settings.xml的位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆