Two different paths for importing gradle project result in different underlying gradle version


(davidmichaelkarr) #1

I’m using Win7 and Neon.2, which has Buildship 1.0.21.

From the shell, in my empty git repository (that I had earlier imported into Eclipse as a git repo), I created the initial skeleton of a gradle project, with the wrapper specified to use Gradle 3.3.

I verified that “…/gradlew --version” prints 3.3.

I then tried to import the Gradle project into Eclipse, using two different paths.

I first tried the top-level “File”->“Import…” option. I selected “Projects from Git”, then “Existing local repository”, then the repository with my skeleton project, then “Import using the New Project wizard”, then “Gradle Project”. I clicked through the “Welcome” page. I entered the name that I wanted for the project and clicked Next. On the “Gradle Distribution” page, I selected “Gradle wrapper” (note that the unchecked “Specific Gradle version” choice had “3.3” in the dropdown). On the “Import Preview” page, it said it was using Gradle 2.14.1, along with a warning saying that some buildship functionality won’t be available. I cancelled this for now.

I then tried “File”->“Import…” again, but selected “Gradle Project” this time. I clicked through the “Welcome” page and the “root directory” page. On the “Gradle Distribution” page, I selected “Gradle wrapper” (note that the unchecked “Specific Gradle version” choice had “3.3” in the dropdown). On the “Import Preview” page, it said it was using Gradle 3.3.

Can someone explain that discrepancy?

(Actually, the FIRST thing I tried was “Import Projects…” from the context menu of the git repo, but that doesn’t even know about Gradle yet.)


(Stefan Oehme) #2

This will unfortunately do exactly what it says: It creates a new project nested inside your repository. It does not import the one that’s already in your repo. That’s why it doesn’t respect your wrapper.properties.

It’s a super misleading EGit feature and I don’t understand why it even exists.