blob: 4a5b6df880c0b3daccb78122e30acbf8d77f8672 [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>
Overlapping products in a common source tree
</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Overlapping products in a common source tree
</h1>
<h3>Layout on file system</h3>
<ul>
<li>The Java source files for products are all held in a single main directory.</li>
<li>Products are separated into four siblings packages <i><code>Product1</code></i>, <i><code>Product2</code></i>, <i><code>Product3</code></i> and <i><code>Product4</code></i>.</li>
<p><img src="../images/qs-WorkingWithExistingLayout20.png" alt="Layout 20"></p>
</ul>
<h3>Steps for defining corresponding &quot;Product1&quot; and &quot;Product2&quot; projects</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;Product1&quot; in the <strong>Project name</strong> field. Click <strong>Next</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout41.png" alt="Layout 41"></p>
</li>
<li>
<p>On the next page, 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-WorkingWithExistingLayout42.png" alt="Layout 42"></p>
</li>
<li>
<p>In <strong>Link Additional Source</strong> click <strong>Browse....</strong> and choose the <i><code>D:\AllJavaSourceFiles</code></i> directory.</p>
<p>Type &quot;src&quot; in <strong>Folder name</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout21.png" alt="Layout 21"></p>
</li>
<li>
<p>Click <strong>OK</strong> to close the dialog.</p>
</li>
<li>
<p>Click <strong>OK</strong> in confirmation dialog to have &quot;Product1/bin&quot; as default output folder.</p>
<p><img src="../images/qs-WorkingWithExistingLayout12.png" alt="Layout 12"></p>
</li>
<li>
<p>Expand the &quot;src&quot; source folder. Select all packages you want to exclude and exclude them using popup-menu.</p>
<p><img src="../images/qs-WorkingWithExistingLayout22.png" alt="Layout 22"></p>
</li>
<li>
<p>Your project source setup now looks as follows:</p>
<p><img src="../images/qs-WorkingWithExistingLayout23.png" alt="Layout 23"></p>
</li>
<li>
<p>Click <strong>Finish</strong>.</p>
</li>
<li>
<p>Copy &quot;Product1&quot; project and paste it as &quot;Product2&quot;.</p>
<p>Edit &quot;Product2&quot; project properties and go on <strong>Java Build Path</strong> page.</p>
<p>Select <strong>Excluded</strong> and click <strong>Edit...</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout24.png" alt="Layout 24"></p>
</li>
<li>
<p>In <strong>Inclusion and Exclusion Patterns</strong>, select &quot;com/xyz/product2&quot; and click <strong>Edit...</strong>.</p>
<p><img src="../images/qs-WorkingWithExistingLayout25.png" alt="Layout 25"></p>
</li>
<li>
<p>Change &quot;com/xyz/product2&quot; to &quot;com/xyz/product1&quot; instead.</p>
<p><img src="../images/qs-WorkingWithExistingLayout26.png" alt="Layout 26"></p>
</li>
<li>
<p>Click <strong>OK</strong> three times to valid and close all dialogs.</p>
</li>
<li>
<p>You now have two Java projects which respectively contain the sources of &quot;product1&quot;, &quot;product2&quot;.</p>
<p><img src="../images/qs-WorkingWithExistingLayout27.png" alt="Layout 27"></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>