Question

I am using Sikuli in my project to handle some flash buttons. It's working fine while running scripts locally. The issue is that when I need to run the build.gradle, I need to have the Sikuli dependency in build.gradle. That is how I have written build.gradle. When I run the build, I get this error:

  • What went wrong: Could not resolve all dependencies for configuration ':compile'.

    Could not find com.googlecode.javacpp:javacpp:0.1. Required by: :new_qa_automation:1.0 > org.sikuli:sikuli-api:1.0.2 > org.sikuli:sikuli-c ore:1.0.1 Could not find com.googlecode.javacv:javacv:0.1. Required by: :new_qa_automation:1.0 > org.sikuli:sikuli-api:1.0.2 > org.sikuli:sikuli-c ore:1.0.1

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED.

Here is my build.gradle file

apply plugin: 'java' version = '1.0' apply plugin: 'project-report'

repositories { mavenCentral() maven { url "http://repo.springsource.org/release" url "http://oss.sonatype.org/content/groups/public/" } }

sourceCompatibility = 1.6 targetCompatibility = 1.6

configurations { cucumberRuntime { extendsFrom testRuntime } }

task test(overwrite: true) { dependsOn assemble, processTestResources, compileTestJava doLast { javaexec { main = "cucumber.api.cli.Main" classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
//some args

        systemProperties System.properties
    }
} }   

dependencies { compile 'org.seleniumhq.selenium:selenium-java:2.32.+' compile 'org.apache.commons:commons-lang3:3.1' compile 'org.springframework:spring-context:3.2.3.RELEASE' compile group: 'org.sikuli', name: 'sikuli-api', version: '1.0.+' compile group: 'commons-collections', name: 'commons-collections', version: '3.+' testCompile 'info.cukes:cucumber-java:1.1.2' testCompile 'info.cukes:cucumber-spring:1.1.2'
testCompile 'info.cukes:cucumber-junit:1.1.2'
testCompile 'junit:junit:4.11' testCompile 'org.easytesting:fest-assert-core:2.0+' }

Edit:

I added the URL for the Maven repositry. Now the error has changed to

ePage.java:9: error: package org.sikuli.script does not exist import org.sikuli.script.FindFailed;

Was it helpful?

Solution

sikuli-script.jar in Sikuli IDE project not provide in any repository so you must use it like a 3rd party jar

see: "Mavan's central repository will not answer on any Sikuli stuff" https://answers.launchpad.net/sikuli/+question/185713

"Gradle: Make a 3rd party jar available to local gradle repository" Gradle: Make a 3rd party jar available to local gradle repository

OTHER TIPS

The Sikuli code base appears to be fragmented. It's quite confusing; I know of 3 different sets of Java bindings. (one, two, three)

I think the one you're pulling with Maven is this: http://code.google.com/p/sikuli-api/

If so, org.sikuli.script is not the right import. You don't include your code to show me what you're trying to do with Sikuli, but most of the things you'd want to import are somewhere under org.sikuli.api.

Just download the sikulix jar and mention it in build.gradle

eg: compile files('C:\Users\vedavyasa\Documents\jar\sikulixapi.jar')

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top