Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Project imported from git on 2020-12 doesn't know it's a java project
Project imported from git on 2020-12 doesn't know it's a java project [message #1836048] Fri, 18 December 2020 23:16 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 722
Registered: July 2009
Senior Member
I've been working on projects using git, Java, SpringBoot, and Maven for quite a while now. These projects were working fine in 2020-09, along with the Groovy and Spring plugins. I had imported the projects from git, and it recognized the projects as maven and java projects.

I just installed 2020-12. I exported my preferences from the 2020-09 workspace and imported them into my 2020-12 workspace. I had all the same plugins installed.

When I imported those same projects into this new workspace, I initially noticed that I was getting "Plugin execution not covered by lifecycle configuration" errors (detailed at https://stackoverflow.com/questions/65349325/eclipse-2020-12-m2e-is-reporting-plugin-execution-not-covered-although-2020-09 ). I thought for a while this was a "missing connector" issue, but it's not suggesting any connectors.

Then I noticed that the underlying problem may be that when Eclipse imports the project, it's not detecting that it's a Java project. It IS detecting that it is a Maven project, just not Java.

I compared the ".project" file I get after import with the .project file I have for the same git repository imported into my 2020-09 workspace. The project in my 2020-09 workspace has the "maven2Builder", but it also has the "javabuilder" and the "springbootbuilder". In my 2020-12 project, it only has the "maven2Builder". There is a similar disparity in the "natures" list.

I then tried simply copying the .project and .classpath files from the local repository that I used to import into my 2020-09 workspace and copied them into the local repository I used to import into the 2020-12 workspace. That fixed the project. Note that the two local repositories are clones of the same remote workspace, but I cloned them separately to ensure that any local changes only affected a specific project.

In the past, I believe I've seen occurrences of the project import not detecting that the project was a Maven project. My workaround was doing exactly what I did here, copying the correct .project and .classpath files from an existing working import. In this case, instead of failing to detect the Maven nature, it failed to detect the Java and SpringBoot natures.

I suppose there may be some magic here that I'm expecting that may not actually be present. If it can't magically determine it's a Java project, what are the proper steps that I should be performing to tell it that it is. I would assume that directly editing the .project and .classpath files would NOT be the correct process.
Re: Project imported from git on 2020-12 doesn't know it's a java project [message #1836055 is a reply to message #1836048] Sat, 19 December 2020 05:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31832
Registered: July 2009
Senior Member
There's a lack of question marks in your post.

The parts of your post that relate to features provided by the m2e project (i.e., Maven integration) should be directed to the m2e mailing list:

https://www.eclipse.org/m2e/m2e-community.html

For any project on which I work, I commit the .project and .classfiles to Git so none of the above is a problem.

Magically creating the correct such files from thin air is not a feature provided by the JDT project. EGit appears to have some detect/configure natures and some ability to configure projects, but I don't use those so I can't comment on that. Look here to ask about that:

https://www.eclipse.org/egit/support/


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Project imported from git on 2020-12 doesn't know it's a java project [message #1836056 is a reply to message #1836055] Sat, 19 December 2020 06:17 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7096
Registered: July 2009
Senior Member
Hi

Indeed. I have no idea how you have managed to avoid committing the .project file to your project. Presumably you have inadvertently marked it as .gitignore. (Edit the .gitignore manually to verify and correct.) While there is some kind of .project inference capability in GIT, like Ed M, I have never used it. I have no idea how it can know that for instance my project does or does not need an Xtext nature. Relying on tools to be cleverer than the original designer is very foolish.

Regards

Ed Willink
Previous Topic:[Resolved]class is not accessible (Eclipse IDE 2020-09)
Next Topic:jdt plugin error
Goto Forum:
  


Current Time: Thu Apr 15 03:26:48 GMT 2021

Powered by FUDForum. Page generated in 0.01530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top