Sorry if this has been asked before, but when I try to do a search for ".project", the Google search seems to ingore the dot, and returns topics that simply have the word "project" in them, making it difficult to find relevant posts.

Let's say I'm importing source from a 3rd party, either from CVS, or because they've sent me a zip file, or something like that. The source contains a file ".project" in the root of the project, but the client is not using Eclipse for their development, so the contents of the file are not what Eclipse expects.

What's the best way of importing projects like this in Eclipse, ideally preserving the 3rd party's source code organization and file names and contents as much as possible?

On 11/12/09 1:30 AM, Oliver Wong wrote:
> Let's say I'm importing source from a 3rd party, either from CVS, or
> because they've sent me a zip file, or something like that. The source
> contains a file ".project" in the root of the project, but the client is
> not using Eclipse for their development, so the contents of the file are
> not what Eclipse expects.

Create a project in Eclipse and use the Import->Archive File to get the
contents into that project

Eclipse then tells me: "Problems were encountered during import: Failed to read the project description file (.project) for 'Test'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state."

So this doesn't solve my problem. Again, to clarify, the code I want to import already has a file called ".project" which is not the XML file which Eclipse expects, so I was expecting this error message. What I need is for a way to tell Eclipse to look elsewhere for the project settings that it normally stores in its ".project" file.

On 12/11/09 5:02 AM, Oliver Wong wrote:
> Okay, so as a test, in my OS, I created a file named ".project" and I
> just put the string "Hello" in it. Then, I zip up this file into a
> "project.zip" file.
>
> I then go into Eclipse, create a new project called "Test", choose
> "Import Archive File", and select my "project.zip" file.
>
> I leave all the other settings on default, and click "finish".
>
> Eclipse asks me "Overwrite '.project' in folder 'Test'?" and I say yes.
>
> Eclipse then tells me: "Problems were encountered during import: Failed
> to read the project description file (.project) for 'Test'. The file has
> been changed on disk, and it now contains invalid information. The
> project will not function properly until the description file is
> restored to a valid state."
>
> So this doesn't solve my problem. Again, to clarify, the code I want to
> import already has a file called ".project" which is not the XML file
> which Eclipse expects, so I was expecting this error message. What I
> need is for a way to tell Eclipse to look elsewhere for the project
> settings that it normally stores in its ".project" file.

If you can't change the name of the existing .project file then you're
in a bind. Eclipse can't use any other file name (although there is some
lengthy discussion at https://bugs.eclipse.org/bugs/show_bug.cgi?id=78438 ). Basically, it's a
chicken-and-egg problem.
As Rich said, you might be able to fudge it by importing into a
sub-directory of your Eclipse project; how well that will work for
day-to-day development probably depends on how the project is structured.