Page tree
Skip to end of metadata
Go to start of metadata
Tutorial that shows how to access and clone a project from the Git repository using Eclipse.

Goals

This tutorial provides step-by-step instructions on how to:

  • Download the EGit plugin - optional
  • Locate a repository in Magnolia CMS Gitweb
  • Retrieve and clone a repository
  • Import Maven projects

Recent Eclipse releases already included GIT support. Users might not have to install EGit anymore, just use built-in Eclipse function.

Git and Eclipse

Git and Eclipse are third party software. If you are new to Git or to distributed version control systems in general, make sure you read Git for Eclipse Users first. More background and details can be found in the on-line book Pro Git.

See also:

Using Eclipse to access the Magnolia CMS codebase on Git

Please ignore downloading and installing EGit if your Eclipse already has GIT support.

Downloading the EGit plugin (optional)

To access the Magnolia CMS Git repository you need the EGit plugin for Eclipse.

  1. Go to the Eclipse marketplace and search for "EGit". 



  2. Download the latest version and restart Eclipse.





  3. When Eclipse restarts, select from the top menu bar  Window → Open Perspective  Other... to see the available perspectives - including the newly added Git Repository Exploring

Accessing the Magnolia repository

To access the Magnolia CMS Git repository:

  1. Open Eclipse and select or create a local workspace to save the cloned repository in.

  2. Go to Git view perspective


Locate the repository URL in Gitweb

To retrieve and clone a repository you first need to locate and copy the path to that repository.

  1. Go to Magnolia GIT web https://git.magnolia-cms.com/ Note that you may be asked to insert your credentials.
  2. Browse to the URL of the repository.
  3. Copy the full repository path then paste to your Eclipse Git View.

Cloning the repository

Cloning the Git repository means copying the repository content to your local machine.

  1. Enter the URL (referred to as URI in Eclipse) of the source repository. Note that the Host and Repository paths populate automatically when you provide the full URL.



  2. Select the transfer Protocol and provide your Magnolia CMS Git repository credentials to your Eclipse instance. The transfer protocol specified in Eclipse should be the same as that specified in the URL in Gitweb.
  3. If you will be accessing Git frequently, select the Store in Secure Store checkbox.
  4. Click Next.



  5. The cloning process consists of two aspects:
    1. Branch info download
    2. Specific branch/file cloning
  6. When Eclipse has finished getting the branch information, select the branch(es) you wish to clone.
  7. Click Next and then choose the local directory to store the cloned files in. The default save location is the workspace you selected/created on opening Eclipse.



  8. When the cloning process is complete the cloned files will be available in your Eclipse workbench. Going forward you can search for and clone files directly from within Eclipse.

Importing a Maven Project

  1. In the Git Repositories view, right-click the project and select Import Projects.



  2. On the dialog, select the required option and click Next/Finish.



  3. Select the Maven Wizard and then the specific Maven artifact.

8 Comments

  1. Right clicking on the ee-bundle node in the EGit perspective and choosing Import Projects... for some reason did not detect the projects to import for me (using Eclipse Kepler on Ubuntu). However, I was able to import using the traditional method (File → Import...).

  2. Thanks for this! Welcome to Magnolia!

  3. Gavan Stockdale Can you tell me if this is the correct way to create the Maven Eclipse Project from the GIT Repository: http://git.magnolia-cms.com/git/ce-bundle.pub.git

    1. Selecting "Maven Project" from the Maven Wizards.
    2. Next Dialog, "New Maven Project", "Select project name and location":
      1. [ X ] Use default Workspace location.
    3. Next Dialog, "New Maven Project", "Select an Archetype": cutted_2014-09-10 11_34_11-Greenshot.png
      1. Catalog: All Catalogs
      2. Filter:
      3. Selected row -> (representing the colums with values):
        1. Group Id: "org.apache.maven.archetypes"
        2. Artifact Id: "maven-archetype-webapp"
        3. Version: "RELEASE"
      4. [ X ] Show the last version of Archetype only.
    4. Next Dialog, "New Maven Project", "Enter a group id for the artifact.": cutted_2014-09-10 11_35_42-Greenshot.png
      1. Group Id: com.magnolia.ce.bundle
      2. Artifact Id: magnolia-ce-bundle
      3. Version: 0.0.1-SNAPSHOT
      4. Package: war
      5. Properties available from archetype: ?

    if so, I will extend this wiki page.

  4. We have tutorials on setting up projects with Maven in Academy and in Documentation.

    http://academy.magnolia-cms.com/display/MA/M3+Professional+quick+start

    http://academy.magnolia-cms.com/display/MA/2.+Setting+up+projects+and+modules

    I'm reluctant now to endorse wiki because it became what we refer to as wild west. Maybe check out what we have in official publication stream first. 

    Another thing is that just by adding a note here people will see your work - including the attached images. I'll see what my colleague Lars Fischer has to say. At first glance looks like it could warrant a new heading etc.  - but  I need someone internal (not me) to give it a rubber stamp.  

  5. Here's an idea. Check the official publication stream. If you can get the same result or better with YOUR neat instruction set, i'll gladly link to it and endorse. Anything that clarifies/simplifies how to do this is fine, provided it takes into account other needs, such as adding new modules etc. 

  6. Okay, after my lunch I will read and thing about what you have writen me. But it could be that I will comment many pages in the next days. I can correct or extend wiki pages, but more after lunch.

  7. back. First thing which I had to notice, is that I can't delete an comment. My previous thinking was that I can delete my comments and clean up the comment area of an wiki page, after the changes are worked into the special wikipage. Or even to hide / my comment for this version of the wikipage.

    I check again CE wiki and official publication stream (official documentation is meant.). In this morning I started with the official documentation, specially with the right-half "Develop". I followed the instruction of the first wikipage of Develop  and the Eclipse-Page has let me going to this wikipage... - but, stop! You are right. It's like wild west here! Thanks for pointing me back to official documentation also to remind me that there is an academy program.

    For extending the wiki with usfully information I will use new Images, not my used in the comments. The comment was only to clearify and get some examples and to talk about it. Nobody can work with my enviroment, they need an more common view per topic in the wiki. I think Magnolia has some information pages about how to extending and writing an wiki article, before I will do such a work, I check these documents. I'm currently not an expert in Eclipse with Maven, so for me this page was looking like not finished, because now comes some Dialogs with Individual Settings and that needs some more explaining. This stuff is basic Maven and can be understand if you have already done an Maven Project, so I could now start to read recursive the documentations, cascading into the maven documentation and coming back Magnolia.

  8. I am new to git, can someone let me know, How to create user or get credentials for http://git.magnolia-cms.com.