title: Error when building fragment with Tycho: "xyz.fragment cannot be installed in this environment because its filter is not applicable"
body: <p>While running <code>mvn install</code> on a fragment project in Eclipse I got this error:</p>
  
  <blockquote>
    <p>${fragment name} cannot be installed in this environment because its filter is not applicable.</p>
  </blockquote>
  
  <p>Using <code>Eclipse-PlatformFilter: (osgi.os=macosx)</code> in the Manifest breaks the build.</p>
  
  <p>Here's the output surrounding the key error (IDs/directory names redacted):</p>
  
  <pre><code>[INFO] Resolving dependencies of MavenProject: ${fragmentID}:4.3.0-SNAPSHOT @ ${fragmentDir}/pom.xml
  [INFO] {osgi.os=linux, org.eclipse.update.install.features=true, osgi.arch=x86_64, osgi.ws=gtk}
  [ERROR] Cannot resolve project dependencies:
  [ERROR]   Problems resolving provisioning plan.:
  [ERROR]      ${fragment name} cannot be installed in this environment because its filter is not applicable.
  [ERROR] 
  [ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
  </code></pre>
  
  <p>The link (<a href="http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting" rel="nofollow">http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting</a>) doesn't help.</p>
  
  <p>I found a few similar errors on the internet (<code>component X cannot be installed in this environment because its filter is not applicable</code>), but they all apply to instances where it's downloaded software and there's either no solution or the solution isn't applicable to my case.</p>
  
  <p>Grateful for any help!</p>
  
  <p><strong>Edit:</strong>
  I found that using <code>Eclipse-PlatformFilter: (osgi.os=macosx)</code> in the host plugin works, and also <code>Eclipse-PlatformFilter: (| (osgi.os=macosx) (osgi.os=linux) (osgi.os=win32) )</code> in the fragment works. It seems that the build goes through each environment set in an ancestor pom, and it breaks when the fragment doesn't apply for any one of those environments.... surely there's some flag I could set to prevent that?</p>