2017-12-18 159 views
1

enter image description hereSTS中pom.properties的用途是什么?

嗨,我正在与STS和Git做一个Spring项目。 但是,每当我尝试执行Git Push, 我发现我从未使用过的pom.properties文件始终会自动修改。

1. 所以我总是忽略Git Stash clear或Git Reset。 这是一个聪明的行为?

2. 顺便说一下,pom.properties文件的目的是什么? 我试图在网上找到答案,但我不能。 春季帮助指南也没有给我答案。

如果我能得到答案,我会很高兴。

回答

2

如在“Version Informations Into Your Apps With Maven”中看到的,这个文件将用于显示一种关于对话框中的版本信息,或者也可以在命令行上。

该文件是由archive step创建的。

如果你想忽略它,你可以这样做:

git rm --cached pom.properties 
echo pom.properties>>.gitignore 
git add .gitignore 
git commit -m "Ignore pom.properties" 
git push 

这样的话,仍然会生成文件/修改,但将不再通过您的Git仓库进行跟踪。

由于commentedRalph,所有目标文件夹不应该在Git的

git rm -r --cached target 
echo target/>>.gitginore 
git add .gitignore 
git commit -m "Ignore target folder" 
git push 
+0

(因为它可以每次都被重建)你应该委托混帐忽略完整'target'文件夹! – Ralph

+0

@Ralph我同意(我甚至没有注意到该文件在maven生成的目标文件夹中!)。我已经编辑了相应的答案。 – VonC

+0

@VonC感谢您提供的非常有帮助的答案! – LCL