I currently try to run SWTBot tests on an Eclipse RCP via Maven.
This is my 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, e.g. by adding the following snippet in the <repositories>
section of your parent pom.xml:
<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.