[英]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: 最后我的问题:
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.