简体   繁体   English

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

[英]“Missing requirement: org.eclipse.swtbot.eclipse.core” when running SWTBot tests on the command line with Maven/Tycho

I currently try to run SWTBot tests on an Eclipse RCP via Maven. 我目前尝试通过Maven在Eclipse RCP上运行SWTBot测试。

This is my pom.xml: 这是我的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>

But I get these errors: 但是我得到这些错误:

[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

I don't really know how to satisfy these dependencies, does anyone have a clue? 我真的不知道如何满足这些依赖关系,有人知道吗? :) :)

You need to add the SWTBot p2 repository to the target platform for the Tycho build , eg by adding the following snippet in the <repositories> section of your parent pom.xml: 您需要将SWTBot p2存储库添加到Tycho构建目标平台 ,例如,通过在父pom.xml的<repositories>部分中添加以下代码段:

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

If you need a different version of SWTBot, you can find the links to the p2 repositories in the downloads section of the SWTBot home page . 如果您需要其他版本的SWTBot,则可以在SWTBot主页的下载部分中找到指向p2存储库的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM