为什么不应该在Windows的Maven路径中放置空格? [英] Why shouldn't I put spaces in my Maven path in Windows?

查看:185
本文介绍了为什么不应该在Windows的Maven路径中放置空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Maven Windows先决条件中,它指出,

您需要解压缩Maven发行版.不要在源代码中间解压缩它.选择一些位置(路径中没有空格!),然后在那儿解压缩.

You need to unpack the Maven distribution. Don't unpack it in the middle of your source code; pick some location (with no spaces in the path!) and unpack it there.

路径中是否有空格为什么很重要?

Why does it matter if there are spaces in the path or not?

推荐答案

问题是在Maven中的某个地方,它正在执行一个子进程,并且没有正确地将其文件名参数用双引号引起来.这样的文件位于

The problem is that somewhere in Maven, it is executing a sub process and it is not properly wrapping its file name arguments in double quotes. So a file that is at

"C:\Program Files\Foobar"

在命令行上看起来像2个文件

will look like 2 files on the command line

"C:\Program"
"Files\Foobar"

,但都不是正确的.这是从旧"时代以来的保留,旧"时代不允许在文件名(即1980年代)中使用空格,并且在命令行中使用空格分隔参数.很遗憾这个问题仍然存在.在Linux机器上,情况稍差一些,在迁移到允许在文件名中留有空格的速度较慢的情况下,因此,如果文件名中包含空格,Linux上会有更多的脚本和程序失败.

and neither of those are correct. This is a holdover from the "old" days when spaces were not allowed in file names (ie 1980s) and spaces separated arguments on the command line. It's a shame that this problem still exists. It's slightly worse on Linux machines, which have been slower to migrate to allowing spaces in file names, so there are more scripts and programs on Linux which fail if you have spaces in the file names.

这篇关于为什么不应该在Windows的Maven路径中放置空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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