1

我正在尝试构建一个具有以下组件的混合项目:1:Spring Boot 2:rSocket 3:gRPC

它是一个多容器应用程序,其中容器 1(Spring 和 rSocket、Java)通过 Spring-rSocket 与容器 2(rSocker、Spring、gRPC、Java)交互。然后它通过 rSocket-RPC 将信息传递给容器 3(gRPC、Python)。

自过去 3 天以来一直在尝试,但由于依赖项冲突而能够设置一个 maven 项目,从而导致netty 调用失败。

开始设置 Gradle,与 maven 相比,我对 gradle 还是很陌生。为原型任务提出了以下脚本:

protobuf {
    protoc {
        artifact = 'com.google.protobuf:protoc:3.6.1'
    }
    generatedFilesBaseDir = "${projectDir}/build/generated-sources/"

    plugins {
            rsocketRpc {
            artifact = 'io.rsocket.rpc:rsocket-rpc-protobuf:0.2.17'
        }
    }
    generateProtoTasks {
        all()*.plugins {
            rsocketRpc {}
        }
    }
}

并遵循settings.gradle中的 pluginManagement

pluginManagement {
    repositories {
        maven { url 'https://repo.spring.io/snapshot' }
        maven { url 'https://repo.spring.io/milestone' }
        maven { url 'https://repository.jboss.org/nexus/content/repositories/public/' }
//        maven { url 'https://jcenter.bintray.com/' }
        jcenter()
        maven { url 'https://dl.bintray.com/netifi/netifi-oss/' }
        gradlePluginPortal()
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == 'org.springframework.boot') {
                useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
            }
        }
    }
}

但是构建总是失败,说它无法找到插件:

AzureAD+DebasishKanhar@DESKTOP-COEQQIB MINGW64 /d/Projects/Projects/Freelancing/Elysium Analytics/sia/graphdb/snowflake-graphdb/graphextractor_gradle (custom-graphdb-snowflake)
$ gradle build
> Task :generateProto FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_rsocketRpc'.
   > Could not find rsocket-rpc-protobuf-0.2.17-windows-x86_64.exe (io.rsocket.rpc:rsocket-rpc-protobuf:0.2.17).
     Searched in the following locations:
         https://repo.maven.apache.org/maven2/io/rsocket/rpc/rsocket-rpc-protobuf/0.2.17/rsocket-rpc-protobuf-0.2.17-windows-x86_64.exe

看起来它没有在默认的 maven repo中找到插件,这是正确的,因为我知道protoc插件托管在jcenter中。但是,如果您看到了,我已经在pluginManagement中添加了 URL,但是为什么我的构建脚本没有捕获 jcenter 存储库?

任何帮助将非常感激 :-)

4

1 回答 1

1

我自己寻找这个问题的解决方案,我找到了答案。

简而言之,目前似乎没有 Windows 版本,只有 linux。见 https://repo.maven.apache.org/maven2/io/rsocket/rpc/rsocket-rpc-protobuf/0.2.17/

因此,您需要在基于 linux 的操作系统(Ubuntu、Mac 等)或 grpc proto 而不是 rsocket 上进行开发。

真的很羞耻,希望他们在某个时候打包Windows版本

于 2020-09-12T13:11:36.903 回答