Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] build products with optionally included features

Hi Neil,

thank you for your response. 

I proposed a similar question a month or two back. The optional feature does not work like you would hope. I think that is meant more for plugins.


:(

I ended up making two different products because my use case changed, but you can filter out your feature from the target platform when building the product. You can do this by profile and achieve what you need.

I’ve tried the filtering approach as it is described here: 

But then I’m getting the exception stated below. Maybe that’s because I’m building the artifacts and filtering them out in the same reactor. 

org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle my.optional.plugin cannot be resolved
Resolution errors:
   Bundle my.optional.plugin - Missing Constraint: Require-Bundle: foo.bar.baz1; bundle-version="0.0.0"
   Bundle my.optional.plugin - Missing Constraint: Require-Bundle: foo.bar.baz2; bundle-version="0.0.0"
   Bundle my.optional.plugin - Missing Constraint: Require-Bundle: foo.bar.baz3; bundle-version="1.0.0"

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

regards,
  Moritz

Neil

On Jun 17, 2014 10:02 AM, "Moritz Eysholdt" <moritz.eysholdt@xxxxxxxxx> wrote:
Hi,

I’m building an eclipse product and based on the selected maven profile, a certain eclipse feature should be included into the product or not.

I have two feature.xml, lets call them master-feature.xml and optional-feature.xml

master-feature.xml includes optional-feature.xml via 

<includes
         id=“optional.feature"
         version="0.0.0"
         optional="true"/>

The master-feature.xml is always included in the product.

If I build the product with with optional-feature.xml included, all goes well.

If I try to build build the product with optional-feature.xml excluded, I get the error message below:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.20.0:package-feature (default-package-feature) on project master.feature: Execution default-package-feature of goal org.eclipse.tycho:tycho-packaging-plugin:0.20.0:package-feature failed: Could not resolve feature optional.feature_0.0.0; Path to dependency: -> [Help 1]

The optional-feature is indeed not there because I’m using a maven profile to not include its pom.xml build it when it’s not required. 

However, since the feature-inclusion happens via optional=“true”, I’d expect tycho not to complain about it. Is this a bug? Is there another way to build different variants of the same product?

regards,
  Moritz

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top