gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 18:01:44 25 4
gpt4 key购买 nike

我正在尝试下载 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com