Import cannot be resolved by test plugin fragment using Tycho but works in Eclipse
<p>I have a plugin project which I am trying to create a test plugin for. The packages in my plugin project are available to other plugins in my workspace, including the test plugin, but when I try and build my projects using tycho the test plugin is throwing an error stating that the import cannot be resolved.</p>

<pre><code>[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.25.0:compile (default-compile) on project REDACTED.tests: Compilation failure: Compilation failure:
[ERROR] REDACTED/PlanImportTest.java:[7]
[ERROR] import REDACTED.pluginname.Argument;
[ERROR] ^^^^^^^^^^^^
[ERROR] The import REDACTED.pluginname cannot be resolved
</code></pre>

<p>I am new to Tycho so I think there is probably an issue with my project layout, but I can't find a solution to my problem online. Does anyone know why this import is working in eclipse but not when running a maven/tycho build on the command line? Relevant files below.</p>

<p><strong>Plugin manifest:</strong></p>

<pre><code>Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: REDACTED.pluginname
Bundle-SymbolicName: REDACTED.pluginname;singleton:=true
Bundle-Version: 1.0.0.qualifier
Export-Package: REDACTED
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-BuddyPolicy: registered
Eclipse-RegisterBuddy: REDACTED
</code></pre>

<p><strong>Plugin POM:</strong></p>

<pre><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;parent&gt;
        &lt;groupId&gt;REDACTED&lt;/groupId&gt;
        &lt;artifactId&gt;REDACTED&lt;/artifactId&gt;
        &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
        &lt;relativePath&gt;REDACTED&lt;/relativePath&gt;
    &lt;/parent&gt;
    &lt;groupId&gt;REDACTED&lt;/groupId&gt;
    &lt;artifactId&gt;REDACTED.pluginname&lt;/artifactId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;eclipse-plugin&lt;/packaging&gt;
&lt;/project&gt;
</code></pre>

<p><strong>Test class</strong></p>

<pre><code>import static org.junit.Assert.*;
import org.junit.Test;
import REDACTED.pluginname.Argument;

public class PlanImportTest {

    @Test
    public void test() {
        Argument a = null;
        assertTrue(true);
    }
}
</code></pre>

<p><strong>Test project manifest:</strong></p>

<pre><code>Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: REDACTED
Bundle-SymbolicName: REDACTED.tests
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: REDACTED
Fragment-Host: REDACTED.pluginname;bundle-version="1.0.0.qualifier"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit;bundle-version="4.12.0"
</code></pre>

<p><strong>Test project POM:</strong></p>

<pre><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;parent&gt;
        &lt;groupId&gt;REDACTED&lt;/groupId&gt;
        &lt;artifactId&gt;REDACTED&lt;/artifactId&gt;
        &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
        &lt;relativePath&gt;REDACTED&lt;/relativePath&gt;
    &lt;/parent&gt;
    &lt;groupId&gt;REDACTED&lt;/groupId&gt;
    &lt;artifactId&gt;REDACTED.tests&lt;/artifactId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;eclipse-test-plugin&lt;/packaging&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
                &lt;artifactId&gt;tycho-surefire-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;testClass&gt;REDACTED.Test&lt;/testClass&gt;
                    &lt;dependencies&gt;
                        &lt;dependency&gt;
                            &lt;type&gt;eclipse-plugin&lt;/type&gt;
                            &lt;groupId&gt;REDACTED&lt;/groupId&gt;
                            &lt;artifactId&gt;REDACTED.pluginname&lt;/artifactId&gt;
                            &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
                        &lt;/dependency&gt;
                    &lt;/dependencies&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;
</code></pre>