java - 如何下载 protobuf-socket-rpc maven 存储库?

标签 java maven grpc-java

我正在尝试下载 protobuf-socket-rpc 存储库,以便我可以使用类似的类

com.googlecode.protobuf.socketrpc.RpcConnectionFactory;

在java中。我的 Maven 文件如下所示:

<?xml version="1.0" encoding="utf-8"?>
<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>com.example</groupId>
    <artifactId>GroovyExample</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>MMAMatcherGroovyTest</name>

    <dependencies>
    <dependency>
        <groupId>com.googlecode.protobuf.socketrpc</groupId>
        <artifactId>protobuf_socketrpc</artifactId>
        <version>1.3.2</version>
    </dependency>
    </dependencies>
</project>

但是,mvn install 命令首先返回警告:

[WARNING] The POM for com.googlecode.protobuf.socketrpc:protobuf_socketrpc:jar:1.3.2
is missing, no dependency information available

然后出现错误

[ERROR] Failed to execute goal on project GroovyExample: Could not resolve dependencies for 
project com.example:GroovyExample:jar:0.0.1-SNAPSHOT: Failure to find 
com.googlecode.protobuf.socketrpc:protobuf_socketrpc:jar:1.3.2 in 
http://maven2:8081/repository/neurotechnology/ was cached in the local repository, 
resolution will not be reattempted until the update interval of neurotec has elapsed
or updates are forced

我在一家公司工作,maven 首先尝试从我们的本地数据库下载存储库。 如何更新pom.xml文件,以便maven也能下载protobuf-socket-rpc存储库

最佳答案

我在 Maven Central 上找不到 protobuf_socketrpc Artifact (错误消息与我一致)。这是正确的 Artifact 名称吗?或者是本地(maven本地或者你公司的maven)发布的?

我在github上找到了这个库:https://github.com/sdeo/protobuf-socket-rpc/blob/master/java/pom.xml 。看起来该库尚未发布。您需要在本地构建它来解决它。

git clone https://github.com/sdeo/protobuf-socket-rpc.git
cd protobuf-socket-rpc/java
#edit pom.xml to use protobuf-java 2.4.1 (2.4.0 is not published)
mvn install

安装到本地maven后,您应该能够构建上面的示例。

关于java - 如何下载 protobuf-socket-rpc maven 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60616991/

相关文章:

maven - Spring Boot 排除属性文件并在执行时将其提供给 jar

java - lombok 1.16.4 与 maven (jdk7) 不工作

protocol-buffers - 使用基于 Java 的 Grpc 服务器和基于 C# 的客户端时传输失败错误

Java:在 "+"周围分割字符串

java - 如何按原样显示或打印数据库表的内容?

java - 我有两个 ArrayList A & B ,只是想知道数组 A 中的元素是否存在于数组 B 元素中

logging - grpc 记录器级别

java - 单链表: wrong output after adding elements

java - 通过 Maven 在 Tomcat 上重新部署 Web 应用程序

java - 在 grpc-java 中有支持故障转移的官方方法吗?