Bug 232181 - [Wizards] Import existing projects assumes project names by parent directory name and ignores the name in .project
Summary: [Wizards] Import existing projects assumes project names by parent directory ...
Status: RESOLVED DUPLICATE of bug 225754
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-14 16:30 EDT by Sandu Turcan CLA
Modified: 2008-06-10 14:22 EDT (History)
2 users (show)

See Also:


Attachments
Contains sample project to recreate the scenario (55.14 KB, application/octet-stream)
2008-06-05 21:23 EDT, Lee Kon Keong CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandu Turcan CLA 2008-05-14 16:30:10 EDT
Build ID: 3.4M7

Steps To Reproduce:
1. Create a directory called badname
2. Create an empty .project file:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>goodname</name>
</projectDescription>

3. Click Import->Existing project into workspace
4. choose the directory badname

You'll see in the list badname(goodname) and after import the project will be named "badname"


More information:

I looked at org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage.
and found the logic in ProjectRecord.setProjectName.
Not sure if it's intentional and what the rationale is.
But in my particular case this doesn't work well. I'm importing about 20 projects in a complex directory structure where the directory names are different from the project names. Projects depend on each other, so after the initial import all those dependencies don't resolve.
Comment 1 Remy Suen CLA 2008-05-24 12:44:10 EDT
Duplicate of bug 225754?
Comment 2 Lee Kon Keong CLA 2008-06-05 21:23:02 EDT
Created attachment 103872 [details]
Contains sample project to recreate the scenario
Comment 3 Lee Kon Keong CLA 2008-06-05 21:25:31 EDT
I am facing the same issue.

I am running eclipse on Windows XP SP2.
JDK 1.5.0_09

I am using Eclipse 3.4 (ganymede) RC1, now.
eclipse-jee-ganymede-RC1-win32.zip

Before that, I was using Eclipse 3.3.2 SDK and I download/install/update 
with WTP packages.


When I do "import project", Eclipse 3.3.2 will use the value (project name) that I have set in the ".project" file.

But when I switch to using Eclipse 3.4, when it imports project, it will 
use a different project name.


For example, in the ".project" file.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>test01_konkeong</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
</projectDescription>


From Eclipse 3.3.2, do File | Import ... | General | Existing Projects 
into Workspace. Then choose the directory and then Refresh.
It will show "test01_konkeong".

Which is what I want.


 From Eclipse 3.4 RC1, when I do the same step above, it will list 
"test01 (test01_konkeong)". After import successful, it will use the 
name "test01".

Which is not what I want.


Is this behaviour a "new feature"?

Please see attachment.
Comment 4 Boris Bokowski CLA 2008-06-06 12:57:25 EDT
Sandu and/or Lee, could you please try a more recent release candidate build? It looks like this is a duplicate of bug 225754 but I would like you to confirm that the Import wizard works for you again.
Comment 5 Lee Kon Keong CLA 2008-06-09 07:38:06 EDT
Dear Boris,

I have tested using eclipse-jee-ganymede-RC2-win32.zip.
It is now importing as how I want it to be (same as old behaviour).

Thank you so much.
konkeong
Comment 6 Boris Bokowski CLA 2008-06-09 08:19:30 EDT
Thanks for testing, and thanks Remy for the pointer!

*** This bug has been marked as a duplicate of bug 225754 ***
Comment 7 Sandu Turcan CLA 2008-06-10 14:22:05 EDT
(In reply to comment #6)
> Thanks for testing, and thanks Remy for the pointer!
> 
> *** This bug has been marked as a duplicate of bug 225754 ***
> 

Verified, works for me too. Thanks for fixing this.