Missing project in Java build path - project settings

Two java projects are imported into the Eclipse workspace:

  • MainProject
  • SecondProject

The SecondProject build SecondProject requires MainProject .

Before transferring the source code of both projects to our Team Foundation Server , MainProject referred to the SecondProject properties on the tab "Java Build Path" -> "Projects" . And it worked fine.

Now, after both projects have been imported from TFS into the Eclipse workspace through the Team Explorer Everywhere plugin, the MainProject project no longer appears on the "Projects" and in the "Add..." dialog box.

The funny thing is that MainProject also not displayed, for example, in the Project -> Clean... dialog box, but it is displayed in the project properties -> "Project References" dialog box ...

Where could the problem be ???

Eclipse version 3.6.2 (Helios SR2), TFS 2010 SP1

PS If I add <classpathentry kind="src" path="/MainProject"/> to .classpath manually, the error "Project" SecondProject "will appear in which the required Java project is missing:" MainProject "".

+6
source share
4 answers

I may be mistaken, but it seems to me that Eclipse may not see your imported TFS projects as Java projects (Eclipse also supports "simple" projects, among others). When you look at * .java files in the package hierarchy of your projects, do they have blue "J" in the corresponding icons or are they "hollow"?

If the first is true, then Eclipse will see your projects as Java projects, I will be completely confused, and you can ignore my answer;)

If the latter is true, then the project is not configured as a "Java project". This may be a real obstacle to a solution ... but one solution in this case could be to rename your existing projects to something else (for example, MainProjectOld, SecondProjectOld), create new projects "MainProject" and "SystemProject" as new " Java "projects, then copy all the source code from the old to the new source folders. I don't know much about TeamFoundationServer, but I would suggest that at this point you can reconnect your new projects to TFS and validate them as Java projects.

EDIT

The bottom line contains, if the latter is true, then it looks like the project configuration XML files do not get into TFS, and Eclipse gets confused with how it should handle projects (simple, Java or others) after the initial import from TFS. I also saw this in CVS and SVN, so I assume this is a fairly common problem in any version control system supported by Eclipse. TFS can be included in this group.

+8
source

You must make sure that the application has .project, .project may not be available when checking the code from the repository. You must create .project from the command line in the folder where your code contains the mvn eclipse: eclipse command and restart the eclipse.

+1
source
 First go to your project root and edit .project file . make sure there have entry for javabuilder as following . If not then <buildCommand> <name> org.eclipse.jdt.core.javabuilder </name> <arguments> </arguments> </buildCommand> Full .Project file looks like. <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>Your Project </name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature> </natures> </projectDescription> 
0
source

I am not familiar with Team Foundation Server, but I recommend using Maven if you want to build projects inside and outside Eclipse.

-1
source

Source: https://habr.com/ru/post/911319/


All Articles