commit multi modules maven project to gitlab - eclipse

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....

Related

Creating Spring Initializr Project for existing Git repository in Eclipse

I'm confused how to setup my project correct. There is already a existing git repository named "DatabaseHub" which is only containing the README.md after my first commit. Then I have there my Spring Initializr zip which I want to use for this repository. I named it databaseHub as well. It's a Gradle project.
When I'm trying to create the project with this zip in Eclipse in my git project I fail.
What I tried: Cloned the git repo (so it is in the project explorer), tried to import the extracted initializr zip with the option "Existing Gradle project" but this won't work cause of the name collision.
I don't get what's the right attempt to start this. Just putting all the files manually in the repo doesn't let Eclipse know that it's even a project now.
Eclipse version is 2019-09.
Try and unzip that project elsewhere on your disk.
Then go to your local Git repository (the one with the single README) and do:
cd /path/to/local/Git/repo
git --work-tree=/path/to/unzipped/project add .
git restore -- .
git commit -m "Import project"
The git restore -- . step (with Git 2.23+, August 2019) will make sure your imported files are checked out and visible within your local repository.
Finally, import the Gradle project: Eclipse should detect the Git repository in it (if not, do a Team > Share)

git add a maven project to a existing repository

I work with Eclipse and Git. I created a maven project and now I want to add it to the git repository. This repository isn't empty.
The is Eclipse screen
I have some maven projects on the branch transfesa. I want to add the new Maven project to transfesa.
Check your project on disk where it is created.
If it is inside your existing repository you simply can git status and it will show all the new files added under your new project.
If not then create you new projects with other projects(at sibling level hierarchy on the disk). This will let you add and commit new project to existing repository on your branch.

I am not able to see git branch name in eclipse. I have import a 4 projects from among them 2 are showing a git repository and 2 are not showing it

I am not able to see the branch name in eclipse Mars as I have imported a git projects from my local repository. Among 4 projects 2 are showing a branch name and first 2 do not. From a same branch I have added some code in projects which is showing and send it for merge. When i go inside that branch again projects who is showing branch name is contains the code which i have changed but another project who is not showing branch name not contain code changes which i have done while sending merge.
I expect more information here on how exactly you've imported projects into eclipse here.
Generally following are the steps: Try these:
git clone your repository first into a local folder
Use Import.. from File menu
Then under Git folder, select projects from git
Choose existing local repository and Mention the folder that you fetched in step 1. Eclipse will read the git structure if correct folder name is given.
Then import it as General Project by selecting your concerned folder. This step is imported. You should select a folder that you want to keep it parent in your eclipse project. Also use General project.
You can update it to Maven project after the above steps are completed.

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.

Importing multiple maven projects from git into eclipse

I've got a git repository with two Maven projects "foo" and "bar". The structure of the cloned repo is as follows:
myrepo
.git
foo
pom.xml
bar
pom.xml
What I want
Two projects "foo" and "bar" in my workspace with maven nature and working Team menu.
I'm running Eclipse 3.7 with m2e 1.0.0.
I tried the following:
Import -> Check out maven projects from SCM
This clones the repo into a new folder in my workspace folder and imports the two projects, but without connection to git (Team menu is mostly empty).
Import -> Projects from Git
With this option I can only import the entire repo as a single general project (with working Team menu). If I then use "Import -> Existing maven projects", the projects foo and bar are imported but without working Team menu.
Is it possible at all to import multiple projects from a git repo with working Team menus?
As far as I know and are able to perform on my setup (Eclipse 3.7, Egit 1.0.0, m2e 1.0, m2e-egit 0.13), it is not possible in a single step.
The cleanest procedure that I know of is the following:
Clone your Git repository (preferably from Eclipse, otherwise you also need to add the repository to the Git Repositories view);
Import -> Check out existing Maven projects from the root folder of your cloned repo;
Select all the resulting Eclipse projects, and choose Team -> Share project;
Now select Git and check Use or create Repository in parent folder of project.
Long-winded? Sure. But cloning beforehand gives you control over the folder name you check out to, in contrast to Check out Maven projects from SCM which on my machine produces a "maven_{unix_timestamp}" like folder name.
I agree wholeheartedly with you that a quicker procedure should be available.
Here are the steps I used (using eclipse helios, egit and maven plugins)
From git repo perspective, clone your repo (I'm pulling in
git://git.springsource.org/spring-security/spring-security.git for
example)
Use "Import -> Projects from Git" to import as single
general project.
On this project use "Import -> Existing Maven
project" to import separate subprojects.
On each new project, go to "Team -> Share Project ->
Git".
If desired, remove the original project imported in step 2 above. Just remove from workspace, don't remove disk contents.
Create Clone of your Git repository. This can be done by choosing option of clone in'Git Repo Perspective' in eclipse. It will create a local repository in your system. I used bitbucket (GIT) to host my code. It will create a repository with the same name as you have given while creating the repository at your host. At this point of time an empty repository will be created since I have not put anything at host as of now.
Now copy your multimodule Maven project to the local repository which is created in step 1.
Go to eclipse, now click on import --> Projects from GIT -->Existing local Repository -->select your local repository --> import existing projects and we are done.
You will see '?' on your modules. Now select all the projects --> Team -->share projects-->Add index. You will see '+' sign. Now commit and push your changes.
In my case, I have not created the repository at host before hand. I created it through eclipse by pushing the code from my local to host. Vice versa can be done by cloning. If your code is already present at the host, cloning will fetch the code and save it in your local repository and similar steps can be executed to import project into eclipse workspace.