Priority
Major
Type
Bug 
State
Fixed 
Assignee
Anna Kozlova 
Subsystem
Editor. Editing Text 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7104
Fixed in build
8190
Severity
0
  • Submitted by   Melody Dunn
    2 years ago (03 Aug 2007 18:58)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:50)
  • Jira: IDEA-40211
    (history, comments)

IDEA-40211

IDEA deletes .classpath file if it doesn't have a src entry

1
My intellij project is linked to the elcipse .classpath file. Every time the project builds Intellij deletes the .classpath file. The .classpath file does not have a src entry (eg. <classpathentry kind="src" path="sourcepath" />) but if I add one, intellij stops deleting the file.

Environment: windows xp

Issue was closed
Comments (6)
 
History (1)
 
Links
 
Exception Robot
  Exception Robot
21 Aug 2007 09:41
(2 years ago)
#permalink
This behavior is by design, but can be changed relatively easily.
May I ask you why you need a project without a source root?
Melody Dunn
  Melody Dunn
21 Aug 2007 17:37
(2 years ago)
#permalink
The reason I'm linking to .classpath files is because I am the only person on my team currently not using Eclipse (when I can help it). Once example of this is we have several eclipse projects that are simply a collection of libraries. There is no source but other projects depend on them who need those libraries. There are other scenarios but the biggest reason I need the .classpath to not be deleted is that I'd like to be able to use Intellij while the rest of the team is using Eclipse. I can't delete those .classpath files because they are used as library dependencies between Eclipse projects. If we were all working in Intellij, we would set up a module library or project library and wouldn't have this scenario, but I work in a mixed IDE world :). Hope this helps.
Exception Robot
  Exception Robot
31 Aug 2007 08:41
(2 years ago)
#permalink
OK, got it. Hope to be able to resolve it before the final release.
Alexander Chernikov
  Alexander Chernikov
07 Sep 2007 15:27
(2 years ago)
#permalink
7126, 7268: I have managed to reproduce this in case when all settings in .classpath are ignored by IDEA. E.g.:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath>
The "con" path is ignored, because it is JDK. The "output" is ignored by design. After import into IDEA and linking .iml to .classpath the .classpath is erased on each next save. Which is really the defect.

If .classpath has at least one user library:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/annotations"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

It is not erased.
Alexander Chernikov
  Alexander Chernikov
07 Sep 2007 15:41
(2 years ago)
#permalink
It is not erased.

But user meets very bad side effect. Since IDEA thinks that .classpath is not the part of IDEA project anymore, it rejects all changes in .classpath. So, user may change anything in Eclipse: add new libraries, and even source roots, but on return in IDEA and save all .classpath is removed again.
Alexander Chernikov
  Alexander Chernikov
02 Mar 2008 17:29
(23 months ago)
#permalink
7741, 8205: fix confirmed.