blob: d143f70634bfb42ae829c526c68c27eeff2d78f6 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="copyright" content=
"Copyright (c) IBM Corporation and others 2000, 2011. 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=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>
Nesting resources in output directory
</title>
<script language="JavaScript" type="text/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:
<p>
<img src="images/qs-WorkingWithExistingLayout50.png" alt=
"Layout on file system" />
</p>
</li>
</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.svg" alt=
"Opens the Java perspective" /> <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.svg" alt=
"Opens the New Java Project wizard" /> <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 "Product" in the <strong>Project name</strong> field. Click
<strong>Next</strong>.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout51.png" alt=
"New Java Project wizard" />
</p>
</li>
<li>
<p>
On the next page, Type "Product/deliverables" in <strong>Default
output folder</strong> field.
</p>
<p>
Select "Product" source folder.
</p>
<p>
Click <strong>Link additional source</strong> link in
<strong>Details</strong> pane or button <img src=
"images/add_linked_source_to_buildpath.svg" alt=
"Link Additional Source to Project" /> in view bar.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout52.png" alt=
"Java Project Source setup" />
</p>
</li>
<li>
<p>
In <strong>Link Source</strong> click <strong>Browse....</strong> and
choose the <i><code>D:\Product\sources</code></i> directory.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout53.png" alt=
"Link Source dialog" />
</p>
</li>
<li>
<p>
Click <strong>Finish</strong> to validate and close the dialog.
</p>
</li>
<li>
<p>
Again, Select "Product" and click <strong>Link additional
source</strong> link in <strong>Details</strong> pane or button
<img src="images/add_linked_source_to_buildpath.svg" alt=
"Link Additional Source to Project" /> in view bar.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout54.png" alt=
"Java Project Source setup" />
</p>
</li>
<li>
<p>
In <strong>Link Source</strong> click <strong>Browse....</strong> and
choose the <i><code>D:\Product\deliverables</code></i> directory.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout55.png" alt=
"Link Source dialog" />
</p>
</li>
<li>
<p>
Expand the "Product/deliverables" source folder. Select the
"libraries" package and exclude it from build path using either
<strong>Exclude 'libraries' from build path</strong> link or
<strong>Exclude</strong> popup-menu item.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout56.png" alt=
"Exclude 'libraries' from build path" />
</p>
</li>
<li>
<p>
Your project source setup now looks as follows:
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout57.png" alt=
"Java Project Source final setup" />
</p>
</li>
<li>
<p>
Select <strong>Libraries</strong> tab.
</p>
<p>
Click on <strong>Add JARs...</strong>.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout58.png" alt=
"Java Project Libraries setup" />
</p>
</li>
<li>
<p>
Expand "Product" hierarchy to select jar files in "libraries"
directory
</p>
<p>
Click <strong>OK</strong>.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout59.png" alt=
"JAR Selection dialog" />
</p>
</li>
<li>
<p>
Click <strong>Finish</strong> to finalize project creation.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout5a.png" alt=
"Java Project Libraries final setup" />
</p>
</li>
<li>
<p>
You now have a Java project with a "sources" folder and an output
folder which contains nested library resources.
</p>
<p>
<img src="images/qs-WorkingWithExistingLayout5b.png" alt=
"Created Java projects in Workspace" />
</p>
</li>
</ol>
<p class="nav_footer" id="nav_footer">
Next Section: <a href="qs-WorkingWithExistingLayout6.htm">Project using a
source framework with restricted access</a>
</p>
<h3 class="related">Related concepts</h3>
<a href="../concepts/concept-java-project.htm">Java projects</a><br />
<a href="../concepts/concept-java-views.htm">Java views</a>
<h3 class="related">Related references</h3>
<a href="../reference/ref-wizard-java-project.htm">New Java Project
Wizard</a><br />
<a href="../reference/views/ref-view-package-explorer.htm">Package
Explorer View</a>
</body>
</html>