title: Shall I add my unit test folder to the java build path in Eclipse?
body: <p>We are developing an Eclipse product made of several plugins, some of them developed by us. Each of our plugins has be defined as an Eclipse plugin project in workspace and has two folders, source and test. Recently I noticed that we are delivering the test classes to the user like the our source classes. Now I want to remove the test classes from the result of our product. Shall I remove the test folder from the Java build path (see the attachment)? And what else I should do to don't deploy our tests to the end-user?</p>
  
  <p><img src="https://i.stack.imgur.com/J71dm.png" alt="enter image description here"></p>
  
  <p>To build the project we are using the eclipse standard ant script to create our zip file. I don't find where can I exclude test files. Here is the the Ant script:</p>
  
  <pre><code>&lt;property name="allElementsFile" value="${eclipse.pdebuild.scripts}/productBuild/allElements.xml"/&gt;
  &lt;import file="${eclipse.pdebuild.scripts}/build.xml"/&gt;
  &lt;property name="pluginPath" value=""/&gt;
  &lt;property name="pluginList" value=""/&gt;
  &lt;property name="featureList" value=""/&gt;
  &lt;property name="includeLaunchers" value="true"/&gt;
  &lt;property name="generatedBuildProperties" value=""/&gt;
  &lt;condition property="nestedInclusions" value="true"&gt;
      &lt;istrue value="${p2.gathering}" /&gt;
  &lt;/condition&gt;
  
  &lt;!-- ===================================================================== --&gt;
  &lt;!-- main entry point to setup, fetch, generate, build etc. Use --&gt;
  &lt;!-- the customTargets.xml to modify the build behaviour. --&gt;
  &lt;!-- ===================================================================== --&gt;
  &lt;target name="main" description="the main build target"&gt;    
      &lt;antcall target="preBuild" /&gt;
      &lt;antcall target="processRepos"/&gt;
      &lt;antcall target="generateFeature"&gt; &lt;!-- Generate the feature to drive the fetch --&gt;
          &lt;param name="verify" value="false"/&gt;
      &lt;/antcall&gt;
      &lt;antcall target="fetch" /&gt;
      &lt;antcall target="generateFeature"&gt; &lt;!-- We are calling generate feature a second time so that we can get the pack / unpack clause fixed --&gt;
          &lt;param name="verify" value="true"/&gt;
      &lt;/antcall&gt; 
      &lt;antcall target="generate" /&gt; 
      &lt;antcall target="process" /&gt; 
      &lt;antcall target="assemble" /&gt;
      &lt;antcall target="package" /&gt;
      &lt;antcall target="postBuild" /&gt;
  &lt;/target&gt;
  
  &lt;!-- ===================================================================== --&gt;
  &lt;!-- Generate a container feature based on the product file                --&gt;
  &lt;!-- The plugin or feature containing the .product file will need to exist --&gt;
  &lt;!-- already, use preSetup or postSetup to fetch it if necessary           --&gt;
  &lt;!-- ===================================================================== --&gt;
  &lt;target name="generateFeature"&gt;
      &lt;eclipse.generateFeature
          featureId="org.eclipse.pde.build.container.feature"
          buildDirectory="${buildDirectory}"
          baseLocation="${baseLocation}"
          productFile="${product}"
          verify="${verify}"
          pluginPath="${transformedRepoLocation}${path.separator}${pluginPath}"
          configInfo="${configs}"
          pluginList="${pluginList}"
          featureList="${featureList}"
          includeLaunchers="${includeLaunchers}"
          buildPropertiesFile="${generatedBuildProperties}"
          nestedInclusions="${nestedInclusions}"
          filterP2Base="${filterP2Base}"
      /&gt;
  &lt;/target&gt;
  
  
  &lt;/project&gt;
  </code></pre>