Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dealing with sources which already contain a .project file
Dealing with sources which already contain a .project file [message #503089] Thu, 10 December 2009 20:00 Go to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
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?
Re: Dealing with sources which already contain a .project file [message #503137 is a reply to message #503089] Thu, 10 December 2009 23:44 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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

- Prakash
Platform UI Team, IBM

Blog <http://blog.eclipse-tips.com>
Twitter <http://www.twitter.com/Eclipse_Tips>
Re: Dealing with sources which already contain a .project file [message #503244 is a reply to message #503137] Fri, 11 December 2009 10:02 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
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.
Re: Dealing with sources which already contain a .project file [message #503248 is a reply to message #503244] Fri, 11 December 2009 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Hi,

you could try importing one level down, i.e. create project and create a
folder under the project called src. Also create a folder called bin.

Then modify the build properties for that project to use the src folder
for the source instead of the root of the project. Also change the
compiled output path for the src folder to be the bin folder.

And then import the source into that src folder.

--
Thanks,
Rich Kulp
Re: Dealing with sources which already contain a .project file [message #503258 is a reply to message #503244] Fri, 11 December 2009 11:02 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
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.

Hope this helps,
Eric
Previous Topic:Display HTML content into IEditorPart with SWT browser widget by fetching the content from the docum
Next Topic:Funcitonality for "Cleanup" views, other fine-grained control..
Goto Forum:
  


Current Time: Tue Mar 19 04:30:19 GMT 2024

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

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

Back to the top