Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Does Not Seem to Correctly Add Gradle Nature #567

Closed
gchallen opened this issue Sep 12, 2017 · 8 comments
Closed

Git Does Not Seem to Correctly Add Gradle Nature #567

gchallen opened this issue Sep 12, 2017 · 8 comments

Comments

@gchallen
Copy link

gchallen commented Sep 12, 2017

I can't reproduce this yet on my local machine, but I've seen two students today with the following problem:

  1. If they import a project from an existing GitHub repository, the Gradle nature does not seem to be added properly. External dependencies are not added properly, and the project won't build. Gradle is absent from the project menu, and refreshing the Gradle project does nothing. Entering the directory and manually running the build using the wrapper works fine, but also seems to indicate that project dependencies were not properly retrieved previously.

  2. On the other hand, if they (a) clone the project as in 1, (b) delete it (but leave the contents on disk), and then (c) import the local Git project as a Gradle project, rather than a Git project, everything works fine.

Students have installed Eclipse and the Gradle Project using these instructions.

@gchallen gchallen changed the title Git Does Not Seem to Correct Add Gradle Nature Git Does Not Seem to Correctly Add Gradle Nature Sep 12, 2017
@oehme
Copy link
Member

oehme commented Sep 12, 2017

Buildship does not provide integration with the Git import wizard (so this is a duplicate of #356).

You can simplify the workaround to the following:

  • Import using Git wizard
  • Right Click -> Configure -> Add Gradle Nature

@oehme oehme closed this as completed Sep 12, 2017
@gchallen
Copy link
Author

OK, interesting. But why does this work in some environments and not others? Was this integration removed recently?

@oehme
Copy link
Member

oehme commented Sep 12, 2017

This is independent of the environment, it was never supported.

@gchallen
Copy link
Author

gchallen commented Sep 12, 2017

I'm still confused. It does work sometimes, but not consistently.

Let me also point out that this project was a previous Eclipse project. So Gradle support is already added to the .project and .classpath files included in the repository. Perhaps that's the wrong thing to do? But if an existing project has the Gradle nature, and I import it as an existing Eclipse project, shouldn't the new project also have the Gradle nature?

@oehme
Copy link
Member

oehme commented Sep 12, 2017

If it has checked-in .project/.classpath/.settings files, it should work. In that case maybe the students selected "Import as New Project" (which is a really weird feature in EGit that creates a new project in the checked-out folder instead of importing one).

Or potentially you have checked in the .project file, but not the buildship preferences in the .settings folder, which would also lead it to fail.

@gchallen
Copy link
Author

Nope—they are all there. The repository is here. (I did hit the problem with the .settings file earlier. It's somewhat irritating that Gradle seems to change the date in that file repeatedly, despite not modifying the meaningful contents. I had added it to my .gitignore file and then it didn't come over when I copied an existing repository.)

Anyway—I can't say that I remember whether they chose "Import as New Project", but I think that the default is to use an existing project if it can detect one. I'll look at this more carefully if I run across another student with the same issue.

@oehme
Copy link
Member

oehme commented Sep 12, 2017

Can you open an issue for the changing timestamp? That should be simple to fix.

@gchallen
Copy link
Author

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants