Maven:在pom.xml中设置settings.xml的位置吗? [英] Maven: Set the settings.xml location in the pom.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屋!