.hgignore文件未忽略Maven目标/站点目录 [英] .hgignore file is not ignoring the maven target/site directory

查看:119
本文介绍了.hgignore文件未忽略Maven目标/站点目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个基本的Maven/Mercurial设置.我在工作目录中创建了一个.hgignore.我已将以下内容添加到.hgignore文件中(按照 https://www .mercurial-scm.org/wiki/.hgignore

I've created a basic maven/mercurial setup. I've created a .hgignore in the working directory. I have added the following to the .hgignore file (as per the instructions in https://www.mercurial-scm.org/wiki/.hgignore

/target$
/.DS_Store$
.DS_Store$

我的状态为 hg ,一切都被忽略了(如预期的那样)

I had run hg status and everything was ignored (as expected)

我运行了 MVN网站.现在,当我运行 hg status 命令时, target 文件夹中的 site 文件夹中的所有内容都会被忽略. ...例如

I ran mvn site. Now, when I run the hg status command, everything but the site folder is being ignored in the target folder... e.g.

~/dev/blah >hg st  

? target/site/css/maven-base.css
? target/site/css/maven-theme.css
? target/site/css/print.css
...

nb:如前所述,目标文件夹中的其他文件(.class,.xml等)已被忽略...

nb: as stated earlier, the other files in the target folder (.class, .xml, etc...) HAVE been ignored...

目标/站点文件夹尚未添加到存储库中(据我所知...)

The target/site folder has not been added to the repository (as far as I can tell...)

有人知道我要去哪里了吗...?

anyone know where I'm going wrong...?

更新:z3a启发了我尝试 ^ target/* $ ,看来确实成功了...

update: z3a inspired me to try ^target/*$ and that appears to have done the trick...

推荐答案

如果您想忽略目标目录,而不是.hgignore中的目标目录/站点,请输入以下内容:

If you want to ignore the target dir, but not the target/site in your .hgignore put something like this:

syntax: regexp
^target/(?!site)

这篇关于.hgignore文件未忽略Maven目标/站点目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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