Community
Participate
Working Groups
Currently, Eclipse does not allow nesting of jars and zips inside the output directories of a java project. In large corporations like mine, there may be existing projects where this is the default setup. It is not possible to change the way the project is setup just so we can use Eclipse. It is rather easy to get rid of this restriction (Instead of cleaning out the entire output path before a build, you need to clean out everything except the resources.... not a very hard thing to do, considering how much simpler it will make things).
A source folder can coincidate with its own output location, in which case this output can then contain library archives. However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it. For instance, if the project is both the source folder and the output folder, then you can nest libraries in it. Last, if the above setup did not work for you, you could disable the output folder cleaning behavior: Preferences>Java>Compiler>Build Path>Clean output folders on full build Does this work for you?
Downgrading severity
From reporter: The structure of our project is as follows: Source: <ProjectBase>/sourcecode Libraries: <ProjectBase>/Deliverables/Libraries (this folder contains all the jars and zips) Output Path: <ProjectBase>/Deliverables (the class files are put here) This is a very large project and the source is shared among 5 large teams. It is impossible to change the structure of the project. The SCM picks up the contents of the Deliverables directory for the official builds, hence the reason why the Libraries and Output directory are meshed. Given this structure, I cannot even successfully create a project. I have tried both 3.0M5 and the latest 2.1 Release. Is there any workaround/trick that we can use to get around this problem?
I was able to setup a project with following layout: Project +- /sourcecode +- /Deliverables +- /Libraries +- junit.jar an configure it to have the flavor you wanted. Steps: 1- create Java project 2- add source folder 'sourcecode' 3- add source folder 'Deliverables' 4- go to build path project properties 5- set project default output to be 'Deliverables'; now you can nest more items in this output folder (see comment #1). 6- create folder 'Libraries' under 'Deliverables' 7- add some JARs in it (e.g. junit.jar) 8- back to build path properties dialog, add junit.jar to your classpath (if required). My end .classpath looked like below (note you can simply copy/paste it in your Eclipse project once you reveal the .* files). <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="sourcecode"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry excluding="Libraries/" kind="src" path="Deliverables"/> <classpathentry kind="lib" path="Deliverables/Libraries/junit.jar"/> <classpathentry kind="output" path="Deliverables"/> </classpath>
Is it ok now ?
From reporter: Your suggestion worked beautifully. I really appreciate your bringing this issue to closure so quickly. Closing