gradle无法解析配置';的所有依赖项:编译';

gradle无法解析配置';的所有依赖项:编译';,gradle,dependencies,multi-project,Gradle,Dependencies,Multi Project,我有一个依赖性问题需要帮助 我可以自己构建EGLSource fin。 但是当我尝试构建EGL2JS时,我得到了以下错误: 错误消息: :compileJava FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':compile'. > Could not find :swt-64:. Searched i

我有一个依赖性问题需要帮助

我可以自己构建EGLSource fin。 但是当我尝试构建EGL2JS时,我得到了以下错误:

错误消息:

: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
两个项目的构建和设置文件:EGLSource和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']
    }
}
apply plugin: 'java'

repositories {
    flatDir {
        dirs 'lib'
    }
}

dependencies {
    compile name: 'swt-64'
}

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

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    compile project(':EGLSource')
}

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

repositories {
    flatDir {
        dirs 'lib'
    }
}

dependencies {
    compile name: 'swt-64'
}

sourceSets {
    main {
        java.srcDirs = ['src', 'target/generated-sources/antlr4']
    }
}
为什么EGL2JS抱怨EGLSource中存在依赖关系

我可以将swt-64.jar添加到EGL2JS中。但是EGL2JS并不直接依赖于swt-64.jar,所以我不喜欢这种解决方案


是否有其他方法来解决此依赖关系?

因为我不明白这有什么不同

从存储库中删除flatFile 以及不断变化的依赖关系 发件人: 编译名称:“swt-64”

致: 依赖关系{ 编译文件树(目录:“lib”,包括:“swt-64.jar”) }


此外,gradle dependencies不再显示swt-64失败。

您已将存储库依赖项转换为文件依赖项。这就是为什么它会带来不同。我只是不知道你原来的代码片段为什么不起作用。您是否可以通过使用
:swt:64
声明您的依赖项来重试?这有区别吗?