Import existing Gradle Git project into Eclipse
Asked Answered
D

11

61

I've installed eclipse gradle plugin from here

http://kaczanowscy.pl/tomek/2010-03/gradle-ide-integration-eclipse-plugin

Is there a simple way to import into eclipse gradle project using gui, not doing stuff

described here: http://gradle.org/docs/current/userguide/eclipse_plugin.html

?

Defect answered 23/5, 2012 at 15:8 Comment(1)
The most important thing is to have all plugins up-to-date. The Eclipse Buildship Plugin bundled with Eclipse 2020-02 has issues, but the updated version works fine. Caveat: One has to have JavaSE-14 configured as Java Development kit. 14 is the Java version configured in Gradle.Majolica
T
66

Usually it is a simple as adding apply plugin: "eclipse" in your build.gradle and running

cd myProject/
gradle eclipse

and then refreshing your Eclipse project.

Occasionally you'll need to adjust build.gradle to generate Eclipse settings in some very specific way.

There is gradle support for Eclipse if you are using STS, but I'm not sure how good it is.

The only IDE I know that has decent native support for gradle is IntelliJ IDEA. It can do full import of gradle projects from GUI. There is a free Community Edition that you can try.

Tremann answered 24/5, 2012 at 2:58 Comment(1)
Take in account that the question explicitly says that don't want to use the gradle eclipse plugin, i.e. generating an Eclipse project from gradle. The second part of your reply applies.Bitartrate
S
31

There is a simplest and quick way to import a Gradle project into Eclipse. Just download the Gradle plugin for Eclipse from here.
https://marketplace.eclipse.org/content/gradle-integration-eclipse-0

And then from import select Gradle and your project would be imported. Then you have to click on Build Model to run it.


EDIT
Above link for Gradle plugin is no more valid. You can use the link as mentioned in the comment by @vikramvi

https://marketplace.eclipse.org/content/buildship-gradle-integration

Stage answered 19/8, 2015 at 7:45 Comment(8)
I think this might need to be the correct answer not the arcane ones from three years ago.Invent
Can also try Buildship. It's official.Reunion
In Eclipse Neon, Buildship comes pre-installed. You can just import a Gradle project rightaway after installing Eclipse.Reunion
Using STS. Eclipse Marketplace >> search 'buildship.' Now you can import gradle projects.Ampersand
404 - Sorry! We couldn't find it. :(Conformable
link in answer is no more valid, use marketplace.eclipse.org/content/buildship-gradle-integration instead.Puleo
@Reunion You're right there is no need for this, Eclipse Oxygen comes by default with Buildship installed right of the box.Prussia
Also Eclipse Oxygen and Eclipse Photon have the Gradle Buildship preinstalledFarce
L
8

Add the following to your build.gradle

apply plugin: 'eclipse'

and browse to the project directory

gradle eclipse
Lonnielonny answered 11/9, 2013 at 10:41 Comment(0)
K
5

I have gone through this question earlier but did not found complete gui based solution.Today I got a GUI based solution provided by spring.

In short we need to do only that much:

1.Install plugin in eclipse from update site: site link

2.Import project as gradle and browse the .gradle file..that's it.

Complete documentation is here

Keon answered 10/3, 2014 at 8:41 Comment(1)
the link is not available resp deprecated. Use: https://projects.eclipse.org/projects/tools.buildshipFarce
D
4

The simpliest way is to use sts gradle integration and import project

http://static.springsource.org/sts/docs/2.7.0.M1/reference/html/gradle/gradle-sts-tutorial.html

Don't forget to click "Build Model" button.

Defect answered 25/5, 2012 at 15:5 Comment(1)
Sts now gives a warning that's it will soon be decommsioned. Use buildship insteadOrvah
D
4

You can do the following steps:

  1. Install the Buildship Gradle Integration using the Eclipse Marketplace. Simply type Buildship and click on search item. Now click on Install.

  2. Click on File -> Import ▸ Existing Gradle Project.

  3. Navigate to project root directory.

  4. Click on a finish to load your project.

Might be it will take some time for the first time to import Gradle project. So please be patient on it.

Daunt answered 23/6, 2017 at 7:53 Comment(1)
running the search query shows 0 matches in the eclipse marketplace ;( weirdPrussia
B
2

Open eclipse and right click in the package explorer → import Select gradle Browse to the location where you checked out Click “Build Model” Select all the projects and hit finish

Barnie answered 15/8, 2013 at 14:30 Comment(0)
K
2

Go to the GitHub page where they are maintain the official repository: https://github.com/spring-projects/eclipse-integration-gradle/blob/master/README.md

Copy the latest release link: http://dist.springsource.com/release/TOOLS/gradle (latest release)

Use this in Eclipse->Help->Install New Software..->Paste the link in "Work With"->press enter->select the names of the extension->click next and agree the license and follow the prompts.

After you have installed just import the project as a grade project and eclipse will take of the rest.

Kelci answered 6/4, 2016 at 9:24 Comment(0)
E
1

I use another Eclipse plugin to import existing gradle projects.

You can install the Builship Gradle Gntegration 2.0 using the Eclipse Marketplace client.

Then you choose FIle ▸ Import ▸ Existing Gradle Project.

Finially, indicate your project root directory and click finish.

Elaineelam answered 1/2, 2017 at 13:21 Comment(0)
F
0

As of the time of answering this, Eclipse Version: 2020-06 (4.16.0) has a File --> Import --> Gradle --> Existing gradle project menu option.You can use this option to import gradle project into Eclipse directly.

Fronniah answered 21/8, 2020 at 6:58 Comment(0)
G
-4

Add the following to your build.gradle

apply plugin: 'eclipse'

and browse to the project directory

gradle eclipse

Once done, you could import the project from eclipse as simple Java Project.

Goldarned answered 9/5, 2017 at 12:9 Comment(1)
That just rephrases the accepted answer and adds no value.Eakins

© 2022 - 2024 — McMap. All rights reserved.