Community
Participate
Working Groups
My <build>-dir contains some usefull information(liceses, meta-inf and so on) that not belongs to my java packages(i compile project directly to my App's <classes>-dir), but when i invoke <Build Project>-command all the files from <build>-dir are removed and i need to copy it anew. I think this is a problem. Is there a method to prevent such behavior except compiling project to other location and then copy compiled classes to my App's <classes>-dir?
This is a simple configuration problem, referring to the doc should solve your problem. Look for a description of source vs. output folders for Java projects. Or describe your project layout... or paste in your .classpath file... and we can point you in the right direction.
I search documentation for this kind of problem("source vs. output folders for Java projects") and don't find anything that can help me. Here is my .classpath: <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/bkjxu.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/docCollections.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/jspSmartUpload.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/log4j.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/nuConcert.jar" rootpath="" sourcepath="D:/Projects/NEW_nuConcert/nuConcert_src.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/struts.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/xalan.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/xerces.jar"/> <classpathentry kind="lib" path="D:/bea/wlserver6.1/lib/weblogic.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/PortalEngine.jar"/> <classpathentry kind="lib" path="jsp/WEB-INF/lib/ecmascript.jar"/> <classpathentry kind="output" path="jsp\WEB-INF\classes"/> </classpath> Problem is that in "jsp\WEB-INF\classes" some resources that not in "src" are placed and after compiling all is removed.
Look for: "Creating a Java project with source folders" & "Adding a library folder to the build path". 'Problem is that in "jsp\WEB-INF\classes" some resources that not in "src" are placed and after compiling all is removed.' Where do these other resources exist? Do you want to have more than 1 source folder? Or do you want to add a library folder to your classpath?
I already read these topics - it's not about my problem. Let's imagine next situation: I have a web-application. The classes folder for this application is located in "jsp/WEB-INF/classes". This is a classpath of the application, root for the classes. I have a license-file for one of used JARs and this license-file is located directly in classpath, and only in classpath! I have not any more copies of this license-file in source folders nor in any other folder of the application because this is unnecessary for me. Also I have my java source compiled to the same classpath-folder, i.e. my project's output folder is not empty before compile. When I made it with other IDEs new compiled classes appeared in classpath-folder but all other resourced located there(in classpath- folder) before compile remained as before. Eclipse during compile removes all resources from this classpath-folder regardless of its absence in compiled source folders. So, after each compile I need to copy my license-file to the classpath-folder anew. This is my problem.
We are aware of your problem and you have several options... Place the additional files in a library folder called "jsp/WEB-INF/licenses" & then put "jsp/WEB-INF/classes" and the 'new' library folder on your classpath. Or in 2.1 (current milestone build is M3, check the posted schedule for the official release), you can setup your project so the Java builder never cleans the output folder. All existing resources in the output folder are left as is... any generated .class files will overwrite the current ones. The UI for this option is not completed yet but should be in the next few weeks. Look for it in M4.