Compiling resource file causes deletion

Don't know whether this is an EAP (3296) or 4.x problem, as I've been using
3.x up till now.

Compiling a resource file (i.e. anything that matches compile resource
pattern e.g. "a.xml") in a java module can cause it to be deleted.

Have a minimal test case - made new project with single java module, single
directory for source/output/ipr.

Add "a.xml" and then either compile, rebuild or make - seems to delete if
the file is changed. In fact, just discovered that changing the file and
then ctrl-s caused it to be deleted!

Not affected by choice of output path, no version control, no
clear-output-directory-on-rebuild or anything else that seems to relate.
Doesn't appear to occur for non-resource files.









3 comments
Comment actions Permalink

Hmm... never happened to me. Maybe you have your output path set to the same directory as your source path?

0
Comment actions Permalink

Did you set source=output and check Clear output on compile in Compiler Settings?

0
Comment actions Permalink

"Patrik Andersson" <pandersson@gmail.com> wrote in message
news:14044019.1114518630418.JavaMail.itn@is.intellij.net...

Did you set source=output and check Clear output on compile in Compiler

Settings?

I've checked again, and seems to only fail when source=output. Clear output
is definitely not checked.

I wonder whether it is due to "output resource file path" = "input resource
file path" (and so intellij is deleting the "output name" when it spots that
the input file has been updated or you force a compile). This doesn't break
for java source files as the output is a different name (i.e. class...)

If I change the compiler resource options to be empty, then there is no
problem. But I've a project with several web apps, and I need the resource
copying behaviour for these modules.


Anyhow, I got an exception when intellij tried to refresh after the compile
and so the auto "blame IDEA core" button has resulted in #46255. I'll move
this knowledge to the tracker.


0

Please sign in to leave a comment.