Results 1 to 4 of 4

Thread: Clone github repository

  1. #1
    Join Date
    Dec 2011
    Posts
    2

    Default Clone github repository

    Hi guys,

    I'm using STS 2.8.1 release on win7. All I want to do is to clone a repository from github and by doing so create a new grails project from that.
    I tried the following ways:
    1. added the repo in E-git, right click -> import as general project -> project get created in project explorer -> right click on project configure->convert to grails project. At this point I got an error message saying that it doesn't have right to delete some files. (I ran STS in administration mode).

    2. after cloning the repo, I create a new grails project in the folder that the cloning created. This way the new project wizard realizes that the folder is not empty, so it informs me it will import the project. Nevertheless in the next step it throws me an error saying it didn't find the .project file (which is not uploaded on github so of course he doesnt find it). I tried pasting a newly created project's files into it, but the import fails with some other error messages anyway

    3. created a new grails project, right click -> team -> share -> grails, but at this point I couldn't pick any location that would make me proceed or if I did it threw errors again.

    I tried to search online for a solution but I couldn't find. If anyone can point me to a good document / tutorial that could help too. I just need to get a github repository cloned to my sts so I can use it, it doesn't matter how it's done. Any help is greatly appreciated!

    thanks,
    Andrew.

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Andrew!

    Can you point me to the repository you are trying to clone (as long as its a public one)? I would like to take a look and try things out to find the reason for the problem.

    Thanks,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    Dec 2011
    Posts
    2

    Default

    Hi Martin,

    thanks for the answer! In the meantime I could solve the problem, I think the problem was this:
    the project required the "spring-security-core" plugin which I tried to install AFTER I tried converting the general eclipse project into a grails project (which failed probably because it couldn't find the security plugin). Once I added the security plugin first to the project and converted the project to a grails project afterwards, it worked fine.
    (I also switched to grails 2 and groovy 1.8 but that wasn't the fix.)

    So to sum up the steps I needed to do.

    Setting up grails and Eclipse (only ever needs to be done once):

    1. download STS either as a standalone or an Eclipse plugin, add grails as an extension to it. I used Grails 2.0 so I downloaded that from the grails website and added it to Eclipse under window/preferences/Groovy/Grails/ )
    2. set Path to include the java jdk/bin folder as well as the grails home/bin folder
    3. set GRAILS_HOME. I had problems with setting it to "Program Files(x86)", possibly because of the spaces contained in it, so I had to use something like "C:\Progra~2\Grails\grails-2.0.0". (The Path worked fine with setting it to "Program Files(x86)/...").
    4. at this point you should be able to test grails be typing "grails help"
    5. if you have STS standalone version, then it asked already for the jdk path during installation, so it's properly set. If you have it as an eclipse plugin (and you get a warning saying no jdk is specified), then you should go to Eclipse -> Window/Preferences/Java/Installed JREs, and add the java jdk path -> standard VM, set the jre home to something like: "C:\Program Files (x86)\Java\jdk1.6.0_30", and make it default.

    I may have had issues with using different versions of the jdk set in the java path and the jdk set in Eclipse, so if you get warnings/errors for that make sure they match / point to the same jdk.

    Now you can clone the git repo and add it as a grails project like this:

    1. Using Eclipse e-git plugin go to Git Repository Exploring -> clone git repository.
    2. Once the repo is there, right click on it -> import projects -> import as general project. Now you have a general project in the project explorer in Eclipse.
    3. with command line, go to the project folder and run these commands:
    "grails upgrade"
    "grails install-plugin spring-security-core" (this one might not be needed for all projects, but for mine it was, and again, the plugin needs to be added before the following step).
    4. right click on the eclipse project -> configure -> convert to grails project

    For me, these were the steps that worked.

    Maybe this could be documented somewhere, (or maybe it is, I just didn't find it), because it took me a good 2-3 days to solve and perhaps someone else will have hard time with it as well.

    The project is not public, but if you'd like to try something out I think I can give you access to it, so let me know!

    thanks,
    Andrew

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Andrew!

    Glad to hear that you found and solved the problem. And great that you provide us with the setup details here, so that other users can benefit from your experiences and solutions!!! Thanks!!!

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •