我使用Tycho构建多个Eclipse产品。我在詹金斯(Jenkins)的每个应用程序功能中都有一份工作,此外还有一份用于实用程序和一份针对产品。
下图描述了我的设置:
在一项工作('A')中,我构建了一个插件('a')。其版本具有“限定符”占位符。此插件包含在两个不相关的功能中,每个功能都内置在一个单独的作业中(“ B”和“ C”)。这2个作业还构建了特定的插件。最后,我有一个工作“ D”,其中,我的应用程序是使用这两个功能组装而成的。
Both features declare their dependency on the plugin with the special version "0.0.0", i.e. latest version. At compile time, each feature obtains the a.plugin and changes its qualifier. This leads to different qualifiers in each feature.
I sometimes experience the following error, leading my build to fail:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: product.d 1.0.0
[ERROR] Only one of the following can be installed at once: [plugin.a 1.2.3.1234, plugin.a 1.2.3.5678]
[ERROR] Cannot satisfy dependency: product.d 1.0.0 depends on: feature.b 0.0.0
[ERROR] Cannot satisfy dependency: product.d 1.0.0 depends on: feature.c 0.0.0
[ERROR] Cannot satisfy dependency: feature.b 1.0.0 depends on: plugin.a [1.2.3.1234]
[ERROR] Cannot satisfy dependency: feature.c 1.0.0 depends on: plugin.a [1.2.3.5678]
Thus plugin.a being compiled only once, do you know what I could do to have my product resolve this false conflict?
A feature build doesn't change the qualifier of the plug-ins; it uses the plug-in which is available in the target platform without modification. The feature build only modifies files which go into the feature JAR, e.g. it replaces the version in reference to plug-ins with the available version in the feature.xml.
So in case of the described failure in the build of job D, your feature build jobs have seen different versions of plugin.a. This e.g. happens when your jobs build in this order: A (builds plugin.a_1.2.3.1234) - B - A (builds plugin.a_1.2.3.5678) - C - D. When this happens, there is no way that the build of the product (job D) can succeed.
But really the question you should be asking yourself is if you really need this complicated setup. A feature build is close to a NOP in Tycho, so you could just always build your features together with the plug-in(s) in job A.
有潜在的方法甚至可以使复杂的作业设置可靠地工作,例如,通过使用插件引用替换功能之一中的插件,或使用基于SCM的可复制构建限定符(非常高级!)。但是,在您的情况下,所有这些选择似乎都不值得付出努力。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句