我想构建一个仅由我使用Tycho构建的其他功能组成的功能。
所以,假设聚合器功能是com.myurl.feature.agg
在feature.xml文件中,我有几个看起来像这样的条目......
<feature>
...
<includes
id="com.myurl.feature.foo"
version="1.0.12.qualifier"
search-location="both"/>
<includes
id="com.myurl.feature.bar"
version="1.1.4.qualifier"
search-location="both"/>
</feature>
包含的两个功能已成功构建并驻留在我有权访问的p2存储库中,并已经过验证可以正常工作。
我的com.myurl.feature.agg的pom文件有对p2存储库的必要引用,我可以看到它成功找到包含的功能,因为mvn clean install命令的输出...显示是正在“获取”构成com.myurl.feature.foo和com.myurl.feature.bar等功能的正确捆绑包。
但是,不久之后我就收到了这个错误。
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.myurl.feature.agg.feature.group 1.1.5.qualifier
[ERROR] Missing requirement: com.myurl.feature.agg.feature.group 1.1.5.qualifier requires 'com.myurl.feature.bar.feature.group [1.1.4,1.1.5)' but it could not be found
[ERROR]
[ERROR] Internal error: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.myurl.feature.agg.feature.group 1.1.5.qualifier to com.myurl.feature.bar.feature.group [1.1.4,1.1.5).; No solution found because the problem is unsatisfiable.] ->
[Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.myurl.feature.agg.feature.group 1.1.5.qualifier to com.myurl.feature.bar.feature.group [1.1.4,1.1.5).; No solution found because the problem is unsatisfiable.]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:164)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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: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: java.lang.RuntimeException: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.myurl.feature.agg.feature.group 1.1.5.qualifier to com.myurl.feature.bar.feature.group [1.1.4,1.1.5).; No solution found because the problem is unsatisfiable.]
at org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.newResolutionException(AbstractResolutionStrategy.java:98)
at org.eclipse.tycho.p2.resolver.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:88)
at org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.resolve(AbstractResolutionStrategy.java:63)
at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:134)
at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:87)
at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.doResolvePlatform(P2TargetPlatformResolver.java:369)
at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.resolveDependencies(P2TargetPlatformResolver.java:345)
at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:109)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:271)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
... 11 more
任何人都可以帮我弄清楚为什么Tycho没有找到这种依赖关系,即使看起来依赖关系很容易获得并且在构建期间早期成功找到了吗?
答案 0 :(得分:1)
我发现了这个问题。我有一个包含p2存储库中可用功能的功能的事实不是我的问题的原因。你绝对可以用Tycho做到这一点。
我的问题在于p2存储库中的一个功能。有罪的特征是com.myurl.feature.bar。
我对构建或部署p2存储库的方式做错了。我不确定它是什么,但是当我把它撕下来,重建它并重新部署它时,一切都开始正常。
com.myurl.feature.bar功能中更改的一些项目是删除了特定于操作系统的特定条目,这些条目在site.xml上显然是合法的,但不是category.xml文件。我之所以这么说,是因为Eclipse为两者提供的编辑器都有其主要区别。
最奇怪的是,我的RCP应用程序可以成功查看并使用此p2存储库来安装com.myurl.feature.bar,但是tycho无法在构建时使用它来解析依赖关系...至少不是直到我改变了它的p2存储库。
dgolovin的特别说明......据我所知,你绝对可以参考p2存储库中的功能,并将它们包含在你的功能中,即使它们不是你构建的直接部分。
答案 1 :(得分:0)
您应该尝试删除.qualifier。
的问候,
答案 2 :(得分:0)
将feature.xml更改为:
<feature>
...
<requires>
<import feature="com.myurl.feature.foo" version="1.0.12" match="compatible"/>
<import feature="com.myurl.feature.bar" version="1.1.4" match="compatible"/>
</requires>
p2应该从p2存储库中获取最新的可用功能。