Maven Multi-module projects with SVN - eclipse

I have a Maven multi-module project (one parent project with three children). The parents packaging is set to POM.
The issue is SVN wont check in the source code of the child projects (only their pom.xml files). Is there a solution to this?

try this:
first, checkout your parent project, which includes its several children project folders;
after checkout is finished, "File"->"Import"->"Existing Maven Projects", and select the parent project into "Root Directory", you'll see the children project in the "Projects" diagram,
then just select the ones as you want!

Related

commit multi modules maven project to gitlab

I am developing a multimodules maven project on eclipse.
I would like commit on gitlab project. The project has 1 parent module and 3 childs modules.
First I cloned a empty gitlab project, then I created the maven project under my git folder on local pc.
I tried a commit and on stage section there is whole project modules,parents and child. The parents module contains the sources of the child modules.
How can I commit my project on gitlab?
It is possible select the file to commit on the project tree?
Thank you....

Problems with creating multi module maven project from SCM

I wish to create a multimodule maven project from SCM, my svn repository is DEVEO.
Here are the steps i perform in eclipse mars (I have installed m2e plugin + subversive + and required connectors)
Right Click Project Explorer > New > Project
Maven > Checkout Maven Project from SCM
SCM URL :
Click Next
Click Finish
Then there is a popup window saying "No projects found, do you want to create project using new project wizard" I click "OK"
From New Project Wizard, I select Maven > Maven Project
And i create my new project.
When i go into my workspace what i see is
A. Project Folder is not created inside maven folder
B. The Maven folder has no trunk, branches or tags
Ideally project should be created inside Maven folder > trunk. Any Helps
It is better if you:
checkout manually your svn repo outside the Eclipse workspace (without Eclipse running)
make sure your multi-module projet is working (mvn clean install)
Then you can import that project into Eclipse (File/Import Maven project), and Eclipse should detect everything (maven + SVN)
Thanks All,
My purpose was to just use eclipse subversive plugin and not install any external svn client like tortoise. Its kind of a workaround but eventually you can do everything from eclipse. So here is what i did
a. I completely ignored the m2e way of creating project from scm as mentioned in my question.
I simply created a maven multi-module project structure. Right click the root project > Team > Share Project
and then while i am adding the project i use the option "use multiple projects layout with specified root name" and rest is very clear.
I even did not had to create a trunk or tag or branch in my repo separately. It was all done automatically.

Commit multi-module maven project to SVN

I used Maven to create several projects in Eclipse, based on Maven archetypes, and ended up with this project structure (a parent project with multiple modules):
Parent project - pom.xml:
<name>backoffice-root</name>
<modules>
<module>backoffice-web</module>
<module>backoffice-ejb-core</module>
<module>backoffice-ws</module>
<module>backoffice-ear</module>
</modules>
Now I want to commit them to a SVN repository using Subclipse.
In my first approach, I added these projects to SVN in a flat hierarchy. The first project that I added was root, otherwise I'd get a warning saying that .svn folders in modules would be deleted:
backoffice-root
backoffice-web
backoffice-ejb-core
backoffice-ws
backoffice-ear
If I try to commit after that I get an error "backoffice-root/backoffice-web is already under version control". I believe this happens because when I added the projects to SVN, a .svn folder was created inside each one of them, but I don't know how can I solve this problem without deleting these folders and losing the information contained within them.
So I tried a second approach: adding root to SVN and then all the others under root (mapping my Maven project structure to SVN repository), creating this structure in the repository:
backoffice-root
backoffice-web
backoffice-ejb-core
backoffice-ws
backoffice-ear
But when I try to commit all of them, I get the same error of approach #1.
The only way that I get things to work is by just adding root to SVN and committing it (it commits all the modules since they are folders inside root). But I want to work on each project and commit them individually. Do I need to structure my Maven projects in a flat layout like explained in this post? How does one work this way with my original layout?
I'm working with the same your layout and everythings work. My project's skeleton is the following:
parent
-model
-util
-services
-web
model,util,services and web are all modules to parent and are placed in parent directory. Then I committed the parent project (that contains all modules) and finally I checked out and importing (In eclipse File->Import->Maven->Existing Maven Project) all modules.
Update1
Try to describe the procedure along some screenshoot:
Step1 I already committed the parent and all modules
After checkout you will wind the following situation:
where only the parent is linked with the svn. Now you have to do (File->Import->Maven->Existing Maven Project and selected all modules. Then automatically you will have all modules linked at the svn
Update2
My parent definition is the following:
<modules>
<module>model</module>
<module>util</module>
<module>services</module>
<module>vaadin-webapp</module>
</modules>
and each module has instead this configuration
<parent>
<groupId>myCompany</groupId>
<artifactId>myProject</artifactId>
<version>2.2.1-SNAPSHOT</version>
</parent>

SVN Checkout of multi module maven project causing build issues

I am trying to learn how to setup multi-module maven project and share it with colleagues using SVN.
We work with eclipse IDE.
Here is how my project structure looks in SVN.
Each module has its own svn labels and tag trunk, branches, tags etc.
I check out all the modules individually by right clicking on them and choosing check out.
Finally I get the below in my eclipse project explorer:
Here is my pom for the parent project. and this throws errors when I do a mvn clean install
I want to understand how to checkout the projects/ modify my pom to get the build successful.
Thanks
You don't want to check out the root folders of your modules in SVN. All you want is the content of the trunk. So right click on the trunk folder and select Check out as.... Check it out as new projects and enable Maven on those project afterwards. Do this with each of your modules and you should be fine.
If you have Maven SVN connectors installed you have an option called Check out as Maven project. This is very comfortable as it does a few steps for you.

Eclipse sync with svn repo is not available for Maven import project

I have checked in a maven multi module project.If I check in in normal way, as "import - svn Checkout projects from svn" , then the main project is checked in as one folder and it is possible to team -> sync with repositary.
But as the main project is a maven project with multiple modules in it, I tried "import - maven - checkout maven project from scm", selected svn from the drop down list and checked in.Project check in fine.Not only the parent folder, but it lays out all the modules seperately too so that we can work in them individually.The question is, I cant, team ->sync with repositary. That option is not available.
I got it. You have to right click on the project and give share project...