blob: a3c9a83e7a9205737d118517fbde1a139fc93bbb [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>
Nesting resources in output directory
</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Nesting resources in output directory
</h1>
<h3>Layout on file system</h3>
<ul>
<li>The Java source files for a product are laid out both in <i><code>sources</code></i> and <i><code>deliverables</code></i> directories.</li>
<li>All Java class files are laid out in <i><code>deliverables</code></i> directory.</li>
<li>Project needs to use some libraries located in <i><code>deliverables/libraries</code></i> directory:</li>
<p><img src="../images/qs-WorkingWithExistingLayout5.png" alt="Layout 5"></p>
</ul>
<h3>Steps for defining a corresponding project</h3>
<ol>
<li>
<p>Click
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.jdt.ui.JavaPerspective)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png">
<strong>Window &gt; Open Perspective &gt; Other... &gt; Java</strong></a>
to change to the Java perspective.
</p>
</li>
<li>
<p>
Click
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.JavaProjectWizard)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png">
<strong>File &gt; New &gt; Other... &gt; Java Project</strong></a>
to open the <strong>New Java Project</strong> wizard.
</p>
</li>
<li>
<p>Type &quot;Product&quot; in the <strong>Project name</strong> field. Click <strong>Next</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout50.png" alt="Layout 50"></p>
</li>
<li>
<p>On the next page, Type &quot;Product/deliverables&quot; in <strong>Default output folder</strong> field.</p>
<p>Select &quot;Product1&quot; source folder.</p>
<p>Click <strong>Link Additional Source to Project</strong> button <img src="../images/add_linked_source_to_buildpath.png" alt="Link Additional Source to Project"> in view bar.</p>
<p><img src="../images/qs-WorkingWithExistingLayout51.png" alt="Layout 51"></p>
</li>
<li>
<p>In <strong>Link Additional Source</strong> click <strong>Browse....</strong> and choose the <i><code>D:\Product\sources</code></i> directory.</p>
<p><img src="../images/qs-WorkingWithExistingLayout52.png" alt="Layout 52"></p>
</li>
<li>
<p>Click <strong>OK</strong> to close the dialog.</p>
</li>
<li>
<p>Click <strong>OK</strong> in confirmation dialog to remove the project as source folder.</p>
<p><img src="../images/qs-WorkingWithExistingLayout53.png" alt="Layout 53"></p>
</li>
<li>
<p>Repeat previous steps to create source folder "deliverables" linked to <i><code>D:\Product\deliverables</code></i> directory.</p>
<p>Click <strong>Finish</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout54.png" alt="Layout 54"></p>
</li>
<li>
<p>Edit project &quot;Product1&quot;properties and select <strong>Java Builder Path</strong> page.</p>
<p>Expand &quot;Product/deliverables&quot;, select <strong>Excluded</strong> and click <strong>Edit...</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout55.png" alt="Layout 55"></p>
</li>
<li>
<p>Click <strong>Add...</strong> in <strong>Exclusion patterns</strong> part
of the <strong>Inclusion and Exclusion Patterns</strong> dialog.</p>
<p><img src="../images/qs-WorkingWithExistingLayout56.png" alt="Layout 56"></p>
</li>
<li>
<p>Type &quot;libraries/&quot; in <strong>Add Exclusion Pattern</strong> dialog and click <strong>OK</strong> to validate and close the dialog.</p>
<p><img src="../images/qs-WorkingWithExistingLayout57.png" alt="Layout 57"></p>
</li>
<li>
<p>Click <strong>OK</strong> twice to close dialogs.</p>
</li>
<li>
<p>Your project source setup now looks as follows:</p>
<p><img src="../images/qs-WorkingWithExistingLayout58.png" alt="Layout 58"></p>
</li>
<li>
<p>Select <strong>Libraries</strong> tab.</p>
<p>Click on <strong>Add JARs...</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout59.png" alt="Layout 59"></p>
</li>
<li>
<p>Expand &quot;Product&quot; hierarchy to select jar files in &quot;libraries&quot; directory</p>
<p>Click <strong>OK</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout5A.png" alt="Layout 5A"></p>
</li>
<li>
You now have a Java project with a &quot;sources&quot; folder and an output folder which contains nested library resources.
<p><img src="../images/qs-WorkingWithExistingLayout5B.png" alt="Layout 5B"></p>
</li>
</ol>
<p>
<img border="0" src="../images/ngrelc.png" alt="Related concepts" >
</p>
<p>
<a href="../concepts/concepts-3.htm">Java projects</a><br>
<a href="../concepts/concepts-6.htm">Java views</a><br>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="../tasks/tasks-110.htm">Working with build paths</a><br>
<a href="../tasks/tasks-12.htm">Creating a new Java project</a><br>
<a href="../tasks/tasks-14.htm">Creating a Java project with source folders</a><br>
<a href="../tasks/tasks-26.htm">Creating a new source folder</a><br>
<a href="../tasks/tasks-45.htm">Using the Package Explorer</a><br>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference">
</p>
<p>
<a href="../reference/ref-121.htm">New Java Project Wizard</a><br>
<a href="../reference/ref-view-package-explorer.htm">Package Explorer View</a><br>
</p>
</body>
</html>