【发布时间】:2021-12-11 09:29:55
【问题描述】:
在我的 pom.xml 中有
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.6.1</version>
</dependency>
在我的 settings.xml 中,我在活动配置文件的存储库列表中配置了以下内容。
<repository>
<id>google-protobuf</id>
<name>google-protobuf</name>
<url>https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java</url>
</repository>
但是在本地 .m2/repository 中我没有找到任何这样的目录路径 com/google/protobuf,并且我的项目中 protoc 生成的 java 文件没有编译,出现错误
java: com.google.protobuf 包不存在
版本 3.6.1。我在 pom.xml 中使用的 protobuf 依赖项与我的 protoc 编译器版本匹配。
非常感谢任何帮助。
【问题讨论】: