Problems with Eclipse Java project and the output directory
Posted on 2007-04-06
I setup a new project in Eclipse to work out of a previous SVN project checkout of a web application. I set the default output directory to WEB-INF/classes/. I'm having two problems with this setup:
1) I have a log4j.properties file that is versioned and inside the WEB-INF/classes. When I open eclipse, because WEB-INF/classes is the default output directory it removes the log4j.properties file.
2) Since Eclipse by default hides the output folders for the project, I'm not able to access and manage the log4j.properties file. How do I make this visible in the Java perspective?
I suspect a solution you will suggest is to place the log4j.properties file inside the src directory, top-level, because it will then be placed inside the WEB-INF/classes directory. However, this seems to be a "hack" for dealing with eclipse, and I'd rather not have duplicate log4j.properties files in two places.
If the location for the log4j.properties file is supposed to be in the WEB-INF/classes directory, it doesn't make much sense to me to store this in the src file and manage it there.
Do you have any suggestions on how to deal with this problem? What do you usually do when using log4j in Eclipse webapp projects? (I would prefer not installing a third-party webapp plugin into Eclipse.)