我应该如何在 SCM 中配置我的 MAVEN 项目?
我是否应该提交整个代码库以及 POM,并让用户一次检查多个 Maven 项目(其中一个包含多个模块)的项目?
我应该只提交 POM,并在每个 POM 中配置 SCM 信息吗?
配置 Maven SCM 插件时提交/签出如何工作?您是否通过 subversion 存储 POM,检查它们,然后具体化 POM,以便 maven 将其余相应文件下载到该项目?如果您需要添加新文件,但您通过 Maven 使用 SCM,该怎么办?
我对仅使用 svn (标准方式)存储文件与基于每个 pom 存储 SCM 信息之间的区别感到非常困惑。似乎完全没有关于如何使用 Maven 并使用 SCM 信息加载它的文档。
最好将 SCM 信息直接存储在 POM 中,还是像我之前所说的那样,我应该将整个项目(包括它们各自的 POM)添加到 SVN 中?
还是直接将SCM信息嵌入到maven中,让maven具体化该项目更好? Maven SCM 插件与 subclipse 配合得很好吗?例如,当您从 Maven POM“具体化”一个项目后,它是否从 SVN 导入项目文件,然后在 Eclipse 中显示它们,就像在版本控制下一样?如果我将 SCM 信息嵌入到 Maven POM 中,我是否只为我的 pom 文件创建一个单独的 SVN 存储库?或者我可以将所有 POM 文件直接放在我的工程存储库的主干中吗?
希望有人能帮我澄清这一点。我很困惑。谢谢!
Should I commit the ENTIRE codebase, as well as the POM(s), and have users check out projects one at a time for multiple maven projects, one of which contains several modules?
Should I ONLY commit the POMs, and configure SCM information within each POM?
How do commits/check outs work when you configure the maven SCM plugin? Do you store the POM's via subversion, check them out, and then materialize the POM so maven will download the rest of the corresponding files to that project? What if you needed to add new files, but you were using SCM through maven?
I'm very confused about the difference between just storing files using svn (the standard way), vs storing the SCM information on a per-pom basis. There appears to be absolutely NOTHING for documentation on how to use Maven and load it with SCM information.
Is it best to store the SCM information directly inside of POMs, or as I said before, should I just add entire projects to SVN including their respective POMs?
Or is it better to embed the SCM information directly into maven, and have maven materialize said project? Does the Maven SCM plugin play nicely with subclipse? For example - after you "materialize" a project from a maven POM, does it import the project files from SVN, and then show them in eclipse as under version control? If I was embedding SCM information into maven POMs, would I then just create a separate SVN repo for ONLY my pom files? Or would I just put all the POM files directly in the trunk of my engineering repo?
Hopefully someone can help me clarify this. I'm very confused. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
始终将所有源代码提交到 SCM 中。否则你就没有源代码的历史记录。
还要在 SCM 中提交您的 pom,否则您不知道如何构建它。这样的历史记录对于能够构建软件的旧分支至关重要,并且由于构建和源代码如此紧密地耦合,因此最好将 pom.xml 提交到与源代码相同的存储库中。
为了方便其他 Maven 工具,您可能需要在 pom.xml 中提及您的 SCM。这是可选的,但我强烈建议您这样做。这允许 CI 系统验证其源代码副本是否是最新的,并为它们提供在必要时检出新副本所需的配置。
我不知道有任何工具或插件可以实际为您检查代码。如果您不签入源代码,那么所有其他工具都会签出一个简单的 pom.xml(因为这就是 SCM 中的全部内容),并且 SCM 参考将无法告诉任何人源代码在哪里代码是(因为它不在单片机中)。
Always commit all your source code in the SCM. Otherwise you don't have a history of your source code.
Also commit your pom in SCM, otherwise you don't have a history of how it should be built. Such a history is critical for being able to build old branches of your software, and since the build and the source code is so tightly coupled, it is a good idea to commit the pom.xml in the same repository as your source code.
To facilitate other maven tools, you might want to mention your SCM in the pom.xml. That is optional, but I would highly recommend you do it. This allows CI systems to verify that their copy of the source code is the latest, and gives them the configuration needed to checkout a new copy if necessary.
I am not aware of any tool or plugin that actually checks in code for you. If you don't check in your source code, then all the other tools will check out a simple pom.xml (because that's all that is in the SCM), and the SCM reference won't be able to tell anyone where the source code is (because it is not in the SCM).