简体   繁体   中英

Why sometimes eclipse doesn't need .project and .classpath file during importing into workspace/How does eclipse recognize projects as projects?

I just checked out some projects from svn to my pc, and I tried to import the projects into my workspace. But I failed to import some of them, and eclipse didn't recognize those projects(didn't show up in the import window). And then I turn to google and found a solution -"add.projects and.classpath file to project folder" works. However, what make me really confusing is that I foundthe projects I successfully imported into workspace without manually adding the files for them also don't contain.projects and.classpath. Eclipse just create the files for them automatically after import, so it seems that the fail of importing projects(or recognizing projects during import) is not just simply because of the lack of.projects and.classpath. Does anyone know what cause the difference? How does eclipse exactly recognize a project as importable project? * eclipse version info here

Eclipse or any other IDE doesn't required .classpath or .project files. These files will be auto created during the project import. IDE can capable to pull the artifacts from maven central repo automatically by using build descriptor file such as pom.xml or build.graddle .

The files .classpath and .project will store the paths from local machine, if we carry them to another system, the artificats and other dependencies may not be present in the same directory, so it will start complaining build errors. Thats why while committing to GIT always there is .gitignore , so that local configuration will not carry to others while contributing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM