简体   繁体   中英

How svn checkout and checkin maven multimodule project

im having a problem configuring my eclipse + maven + m2e + svn setup.

Lets assume i have project checked in svn trunk with this structure:

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

In my eclipse installation i have:

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". I create it with standard m2e 'Create new maven module' and after completing attributes my workspace looks like this:

- 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". So I want to check it ModuleC in into svn but there is no option with functionality "Share module into 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?
  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)
  3. When you have 'connection' in your case, can you chage something in commited ModuleC and see 'dirty' svn marker on Project-parent?
  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.
  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?

You must also mount the main project in eclipse, the parent of the module. 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. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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