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.

Comment actions Permalink

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

Comment actions Permalink

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

Comment actions Permalink

"Patrik Andersson" <> wrote in message

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


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.


Please sign in to leave a comment.