Community
Participate
Working Groups
I'm trying to setup a multi-environment build with pom-less Tycho. I have a host plugin and two simple platform specific fragments. One for Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86)) and one for Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64)) I configured the target-platform-configuration plugin for multi-environment build this way: <environments> <environment> <os>win32</os> <ws>win32</ws> <arch>x86</arch> </environment> <environment> <os>win32</os> <ws>win32</ws> <arch>x86_64</arch> </environment> </environments> The host and the fragments are listed in the modules section. Running the build I get errors like: [INFO] Computing target platform for MavenProject: my.example:my.fragment.win32.win32.x86:1.0.0-SNAPSHOT @ D:\build\bundles\my.fragment.win32.win32.x86\.polyglot.build.properties [INFO] Resolving dependencies of MavenProject: my.example:my.fragment.win32.win32.x86:1.0.0-SNAPSHOT @ D:\build\bundles\my.fragment.win32.win32.x86\.polyglot.build.properties [INFO] Resolving class path of MavenProject: my.example:my.fragment.win32.win32.x86:1.0.0-SNAPSHOT @ D:\build\bundles\my.fragment.win32.win32.x86\.polyglot.build.properties [INFO] Computing target platform for MavenProject: my.example:my.fragment.win32.win32.x86_64:1.0.0-SNAPSHOT @ D:\build\bundles\my.fragment.win32.win32.x86_64\.polyglot.build.properties [INFO] Resolving dependencies of MavenProject: my.example:my.fragment.win32.win32.x86_64:1.0.0-SNAPSHOT @ D:\build\bundles\my.fragment.win32.win32.x86_64\.polyglot.build.properties [INFO] {osgi.os=win32, org.eclipse.update.install.features=true, osgi.arch=x86, osgi.ws=win32} [ERROR] Cannot resolve project dependencies: [ERROR] Problems resolving provisioning plan.: [ERROR] my.fragment.win32.win32.x86_64 1.0.0.qualifier cannot be installed in this environment because its filter is not applicable. As I can see .polyglot.build.properties I assume it is related to pom-less Tycho. It seems to inspect every module for matches and fails if the platform filter doesn't match the current build environment. I would have expected that bundles that doesn't match are simply skipped so the build doesn't fail.
http://stackoverflow.com/questions/6456684/tycho-eclipse-platformfilter
I can confirm that creating pom.xml files for the platform dependent fragments/plugins with the environment configuration added as showed in the linked stackoverflow question is working. Thanks for the hint. But regarding pom-less Tycho I still think that this is a bug, or at least a missing feature. :) The platform information is contained in the manifest via Eclipse-PlatformFilter manifest header. It is of course an Eclipse only manifest header, but shouldn't it be possible to evaluate the filter for automated environment resolution? As it is a LDAP filter string, I assume it is not a trivial task to solve.
(In reply to Dirk Fauth from comment #2) > I can confirm that creating pom.xml files for the platform dependent > fragments/plugins with the environment configuration added as showed in the > linked stackoverflow question is working. Thanks for the hint. > > But regarding pom-less Tycho I still think that this is a bug, or at least a > missing feature. :) > > The platform information is contained in the manifest via > Eclipse-PlatformFilter manifest header. It is of course an Eclipse only > manifest header, but shouldn't it be possible to evaluate the filter for > automated environment resolution? > > As it is a LDAP filter string, I assume it is not a trivial task to solve. yes it would be nice to automatically set the target environment(s) to be the same as matched by Eclipse-PlatformFilter in MANIFEST.MF as this information is right now basically duplicated in pom.xml. Not sure how straightforward this would be though.
*** Bug 551705 has been marked as a duplicate of this bug. ***
*** Bug 546846 has been marked as a duplicate of this bug. ***
I think this is a tycho-core issue not a pomless issue since tycho-pomless does not knows anything about the target (and literally can't without massive configuration overhead). Can someone share a small project that shows the issue?
Stacktrace produced org.apache.maven.MavenExecutionException: Cannot resolve dependencies of MavenProject: com.vogella.tycho:com.vogella.tycho.plugin2:1.0.0-SNAPSHOT @ /home/lablicate/git/vogella-tycho-example/bundles/com.vogella.tycho.plugin2/.polyglot..META-INF_MANIFEST.MF at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:100) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.eclipse.tycho.artifacts.DependencyResolutionException: Cannot resolve dependencies of MavenProject: com.vogella.tycho:com.vogella.tycho.plugin2:1.0.0-SNAPSHOT @ /home/lablicate/git/vogella-tycho-example/bundles/com.vogella.tycho.plugin2/.polyglot..META-INF_MANIFEST.MF at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:201) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:115) at org.eclipse.tycho.p2.resolver.P2DependencyResolver.doResolveDependencies(P2DependencyResolver.java:366) at org.eclipse.tycho.p2.resolver.P2DependencyResolver.resolveDependencies(P2DependencyResolver.java:334) at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:126) at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95) ... 14 more Caused by: org.eclipse.tycho.p2.util.resolution.ResolverException: See log for details at org.eclipse.tycho.p2.util.resolution.AbstractSlicerResolutionStrategy.slice(AbstractSlicerResolutionStrategy.java:79) at org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:66) at org.eclipse.tycho.p2.util.resolution.AbstractResolutionStrategy.resolve(AbstractResolutionStrategy.java:42) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:194) ... 19 more Caused by: java.lang.IllegalStateException: com.vogella.tycho.plugin2 1.0.0.qualifier cannot be installed in this environment because its filter is not applicable. at org.eclipse.equinox.internal.p2.director.Slicer.validateInput(Slicer.java:109) at org.eclipse.equinox.internal.p2.director.Slicer.slice(Slicer.java:60) at org.eclipse.tycho.p2.util.resolution.AbstractSlicerResolutionStrategy.slice(AbstractSlicerResolutionStrategy.java:76) ... 22 more
org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(TargetPlatform, ReactorProject) iterates about all TargetEnvironments and tries to resolve them. This seems the right place to investigate for the Eclipse-PlatformFilter
I have a possible fix for that but that is currently blocked by 551739
New Gerrit change created: https://git.eclipse.org/r/150544
With this change, a previously failing pomless build (even though you would have the same error without pomless) suceeds without a problem.
Gerrit change https://git.eclipse.org/r/150544 was merged to [master]. Commit: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=31526b28ded726a0bd9a2bbe34ec39190f9818ea
Thanks a lot Christoph. Can you please add a note about it into https://wiki.eclipse.org/Tycho/Release_Notes/1.5#New_and_Noteworthy ?
Done