"缺少要求:org.eclipse.swtbot.eclipse.core"使用Maven / Tycho在命令行上运行SWTBot测试时

时间:2014-11-05 13:17:06

标签: eclipse maven eclipse-rcp tycho swtbot

我目前尝试通过Maven在Eclipse RCP上运行SWTBot测试。

这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.package</groupId>
<artifactId>my.package.swtbot</artifactId>
<version>1.0.0</version>
<packaging>eclipse-test-plugin</packaging>
<parent>
    <groupId>my.package</groupId>
    <artifactId>my.package.parent</artifactId>
    <version>0.0.1</version>
    <relativePath>../my.package.parent/pom.xml</relativePath>
</parent>

但是我得到了这些错误:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: my.package.swtbot 1.0.0
[ERROR]   Missing requirement: my.package.swtbot 1.0.0 requires 'bundle org.eclipse.swtbot.eclipse.core 0.0.0' 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 my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.core 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.gef.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.junit4_x 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.forms.finder 0.0.0.; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.0.v_OTDT_r220_201306071800 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.1.v_OTDT_r221_201309101918 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.2.v_OTDT_r222_201402180730 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; 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 my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.core 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.gef.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.junit4_x 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.forms.finder 0.0.0.; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.0.v_OTDT_r220_201306071800 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.1.v_OTDT_r221_201309101918 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.2.v_OTDT_r222_201402180730 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; No solution found because the problem is unsatisfiable.]
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:166)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    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:483)
    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 my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.core 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.eclipse.gef.finder 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.junit4_x 0.0.0.; Unable to satisfy dependency from my.package.swtbot 1.0.0 to bundle org.eclipse.swtbot.forms.finder 0.0.0.; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.0.v_OTDT_r220_201306071800 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.1.v_OTDT_r221_201309101918 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to satisfy dependency from org.eclipse.jdt.core 3.9.2.v_OTDT_r222_201402180730 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; 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:157)
    at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:107)
    at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.doResolveDependencies(P2TargetPlatformResolver.java:348)
    at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.resolveDependencies(P2TargetPlatformResolver.java:321)
    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:310)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    ... 11 more

我真的不知道如何满足这些依赖关系,有没有人有线索? :)

1 个答案:

答案 0 :(得分:1)

您需要将SWTBot p2存储库添加到target platform for the Tycho build,例如通过在父pom.xml的<repositories>部分添加以下代码段:

<repository>
    <id>swtbot</id>
    <url>http://download.eclipse.org/technology/swtbot/releases/2.2.1/</url>
    <layout>p2</layout>
</repository>

如果您需要不同版本的SWTBot,可以在SWTBot home page的下载部分找到指向p2存储库的链接。