Adding src dir to classpath lets source vanish in project window

Hi,

I'm not sure if this is a bug or wanted behaviour. So if it's wanted behaviour, please tell me what I'm doing wrong.

I have a couple of properties in my source directory tree which will be loaded using the classloader (so they are already at the correct package location within the source tree). When I want to debug/run/test the program, I need to add the source directory to the classpath, so the classloader is able to find the properties. This works well with 3.05.

But when I do this in #963, the source files are not visible anymore within the project view.

What settings do I need to alter to let them be visible again? Or what am I doing wrong?

Thanks for your help.

Andreas

8 comments

BTW, this bug prevents me from using any EAP version > 929. In versions
> 929 and < 963, IDEA crashed, now it does not show the classes.

Tom

0

I have a couple of properties in my source directory tree which will be

loaded using the classloader (so they are already at the correct package
location within the source tree). When I want to debug/run/test the program,
I need to add the source directory to the classpath, so the classloader is
able to find the properties. This works well with 3.05.
>

But when I do this in #963, the source files are not visible anymore

within the project view.

This is a bug, but on the other side, one usually would not have a source
tree to load properties from. Is it possible to set up IDEA compiler so it
would copy certain files like property files from source tree to compiled
class tree?


0

AFAIK it is possible to bind an Ant task to the compile process of IDEA, so you can set up an Ant task to do this job for you.

But I think this is too inconvenient, so I decided to add the source tree to the classpath.

0

... one usually would not have a source
tree to load properties from.


Are you serious? We have dozens of different file types and really large
files. So following issues arise:

1) IDEA is very user unfriendly when specifying the resource pattern
to copy to output directory (Project Properties|Compiler|Resource
patterns (who knows the syntax)?

2) Why wasting time and space for copying already existing files to
another location. Don't tell me, that hd's are cheap now!

My 2 Euro-Cent
Tom

0

IDEA automatically copies any files which match the resource pattern setting
you specify (Project Properties > Compiler > Resource pattern) from the
source directory to the output directory, each time you build. It is clever
enough to copy only the files which have changed, too.

The catch with this is that you end up with two copies of your properties
files, but the benefit is that you can safely delete the output directory
and all the necessary resources will reappear next time you build.

An alternative, if you really can't spare the disk space (like Thomas,
apparently :) ), is to keep all the resources under a separate directory
tree to your code and add only the resources directory to your classpath.

Hope that helps,
Vil.


Andreas Sahlbach wrote:

AFAIK it is possible to bind an Ant task to the compile process of IDEA, so you can set up an Ant task to do this job for you.

But I think this is too inconvenient, so I decided to add the source tree to the classpath.

--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

0

Thank you! I didn't know this, and for some reasons the pattern field was empty here. So I set it up correctly and know it works quite well.

Though IMHO it's still a bug that the src files vanish when setting up the classpath this way.

0

1) IDEA is very user unfriendly when specifying the resource pattern
to copy to output directory (Project Properties|Compiler|Resource
patterns (who knows the syntax)?


We'll fix this.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Thomas Singer" <idea@NOregnisSpam.de> wrote in message
news:bofisj$172$1@is.intellij.net...

... one usually would not have a source
tree to load properties from.

>

Are you serious? We have dozens of different file types and really large
files. So following issues arise:

>

1) IDEA is very user unfriendly when specifying the resource pattern
to copy to output directory (Project Properties|Compiler|Resource
patterns (who knows the syntax)?

>

2) Why wasting time and space for copying already existing files to
another location. Don't tell me, that hd's are cheap now!

>

My 2 Euro-Cent
Tom

>


0

Please sign in to leave a comment.