0

I have a dependencies problem I need help with.

I can build EGLSource fin on its own. But when i try to build EGL2JS then I get this error:

Error message:

:compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find :swt-64:.
  Searched in the following locations:
      https://repo1.maven.org/maven2//swt-64//swt-64-.pom
      https://repo1.maven.org/maven2//swt-64//swt-64-.jar
  Required by:
      :EGL2JS:unspecified > EGL2JS:EGLSource:unspecified

Build and settings files for the two projects: EGLSource and EGL2JS.

EGL2JS: settings.gradle

include ':EGLSource'
project(':EGLSource').projectDir    = new File(settingsDir, '../EGLSource')

EGL2JS: build.gradle

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    compile project(':EGLSource')
}

sourceSets {
    main {
        java.srcDirs = ['src', 'target/generated-sources']
    }
}

EGLSource: build.gradle

apply plugin: 'java'

repositories {
    flatDir {
        dirs 'lib'
    }
}

dependencies {
    compile name: 'swt-64'
}

sourceSets {
    main {
        java.srcDirs = ['src', 'target/generated-sources/antlr4']
    }
}

Why is EGL2JS complaining about a dependency in EGLSource?

I could add the swt-64.jar to EGL2JS. But EGL2JS does not directly depend on swt-64.jar so I don't like that solution.

Are there other ways to resolve this dependency?

1 Answers1

0

For reasons I don't understand this makes a difference.

Removing flatFile from repositories and changing dependencies from: compile name: 'swt-64'

to: dependencies { compile fileTree(dir: 'lib', include: 'swt-64.jar') }

Also gradle dependencies not longer shows swt-64 failed.

  • you converted the repository dependency to a file dependency. that's why it makes a difference. I'm just not sure why your original snippet didn't work. could you try again by declaring your dependency like with `:swt:64`? Does this make a difference? – Rene Groeschke Nov 23 '15 at 07:07