[英]Java Eclipse Maven Version Control
Which of the following files should be version controlled? 以下哪个文件应该受版本控制? And why?
为什么?
None of the above. 以上都不是。 Not only can each of those files be re-created, but they are most likely environment (dev and runtime) specific and they'll take up a lot of space in your repository.
不仅可以重新创建每个文件,而且它们很可能是特定于环境(开发和运行时)的,并且它们将占用存储库中的大量空间。
The simple rule in Maven is: Everything which is in target folder should not be put under version control and the folder itself neither, cause everything in that folder is created from the sources code src/main/ src/test etc. and from the pom.xml file itself. 在Maven中的简单规则是:目标文件夹中的所有内容都不应置于版本控制之下,文件夹本身也不应该,因为该文件夹中的所有内容都是从源代码src / main / src / test等创建的,并且来自pom .xml文件本身。
Files like .project and .classpath should not be versioned, cause they will be generated by an import of a project into Eclipse so usually no need to put them into version control furthermore they are specific to Eclipse. 像.project和.classpath这样的文件不应该被版本化,因为它们将通过将项目导入Eclipse生成,因此通常不需要将它们放入版本控制中,而且它们特定于Eclipse。 In rare situations in can be usefull to put them under version control.
在极少数情况下,可以将它们置于版本控制之下。
The build.properties files is specific for Maven 1 it might be a good idea to put it into version control. build.properties文件特定于Maven 1,将其置于版本控制中可能是个好主意。
None. 没有。 Although I would consider managing the "build.property" file as Maven Build Profiles .
虽然我会考虑将“build.property”文件作为Maven Build Profiles来管理 。 Thus, the file could eventually be version controlled indirectly through the pom.xml file.
因此,该文件最终可以通过pom.xml文件间接进行版本控制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.