简体   繁体   English

如何svn checkout和checkin maven multimodule项目

[英]How svn checkout and checkin maven multimodule project

im having a problem configuring my eclipse + maven + m2e + svn setup. 我在配置我的eclipse + maven + m2e + svn设置时遇到问题。

Lets assume i have project checked in svn trunk with this structure: 让我们假设我在svn trunk中检查了具有以下结构的项目:

- Project-parent
- pom.xml
-- ModuleA
--- pom.xml (module A)
-- ModuleB
--- pom.xml (module B)

In my eclipse installation i have: 在我的eclipse安装中我有:

eclipse 3.7.2 64bit Java EE
subversive and svn connector for svn 1.6
m2e 1.1 from marketplace
m2e-subversive 0.13 (installed from alternative url)

My problem begins when i want to add new module to project. 当我想将新模块添加到项目时,我的问题就开始了。 So i checkout project and modules by "Import -> Check out Maven projects from SCM". 所以我通过“导入 - >从SCM查看Maven项目”结账项目和模块。 I create it with standard m2e 'Create new maven module' and after completing attributes my workspace looks like this: 我使用标准m2e'创建新的maven模块'创建它,并在完成属性后,我的工作区看起来像这样:

- Project-parent (in trunk)
- pom.xml (in trunk)
-- ModuleA (in trunk)
--- pom.xml (in trunk)
-- ModuleB (in trunk)
--- pom.xml (in trunk)
-- ModuleC
--- pom.xml

Project builds with "mvn clean install". 项目使用“mvn clean install”构建。 So I want to check it ModuleC in into svn but there is no option with functionality "Share module into svn". 所以我想将它检查到svn中的ModuleC,但没有选项功能“将模块共享到svn”。

Finally my questions: 最后我的问题:

  1. How do you check in your new modules into existing repository? 如何将新模块签入现有存储库? Is it through eclipse 'Share project' or external tool like Tortoise? 是通过eclipse'Share project'还是像Tortoise这样的外部工具?
  2. If its through Eclipse, do you automatically have 'connection' between module project and svn (by connection i mean annotation on project about svn url and current revision) 如果它通过Eclipse,你是否自动在模块项目和svn之间建立“连接”(通过连接我的意思是关于svn url和当前版本的项目的注释)
  3. When you have 'connection' in your case, can you chage something in commited ModuleC and see 'dirty' svn marker on Project-parent? 当你在你的情况下有'连接'时,你可以在提交的ModuleC中查找某些内容并在Project-parent上看到'dirty'svn标记吗?
  4. How to achieve such connection manually? 如何手动实现这种连接? The only way i could do it is through deleting all projects and again performing "Check out Maven projects from SCM" and picking all projects again. 我能做到的唯一方法是删除所有项目并再次执行“从SCM查看Maven项目”并再次选择所有项目。
  5. When you create submodule sceleton in different location than workspace and then check it into svn, how to import it back to workspace and to m2e from svn? 当您在工作空间的不同位置创建子模块sceleton,然后将其检入svn,如何将其导入工作区并从svn导入m2e?

You must also mount the main project in eclipse, the parent of the module. 您还必须在eclipse中挂载主项目,eclipse是模块的父项。 Then, use this project to check in the new module as you are doing for any change set. 然后,使用此项目检查新模块,就像您为任何更改集所做的那样。 This project is only used for SVN synchronization purpose. 该项目仅用于SVN同步目的。 For your developments, use the module projects. 对于您的开发,请使用模块项目。

For your last question, this is a maven constraint to have its sub module below the parent project. 对于您的上一个问题,这是一个maven约束,使其子模块位于父项目下方。 You won't be able (at least not easily) to create a module somewhere, check it in below the parent and then checkout the whole project with the new module. 您将无法(至少不容易)在某处创建模块,在父项下面检查它,然后使用新模块检出整个项目。

Try to keep it simple. 尽量保持简单。

Use the parent project when you want to synchronize new modules. 如果要同步新模块,请使用父项目。

HIH M. HIH M.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM