Maven ArtifactNotFoundException troubleshooting
The missing dependency is the maven-protoc-plugin, not protobuf-java. This plugin is not available in Maven Central.
According to it’s author you can add a self-hosted repository to the pom.xml:
<pluginRepositories>
<pluginRepository>
<id>protoc-plugin</id>
<url>http://sergei-ivanov.github.com/maven-protoc-plugin/repo/releases/</url>
</pluginRepository>
</pluginRepositories>
But I’m only getting a 404 here. So you can either contact the author or check out the sources and install the plugin manually in your local repository.
VB_
Updated on June 04, 2022Comments
-
VB_ about 2 years
Problem: I'm trying to get Google Protocol Buffers dependencies work. But with no result. Maven just can't pull any protocol buffers dependencies.
Question1: As I understand this dependency is absent in standard maven repositories, so I just need to indicate some extra repositories. Am I right?
Question2: If answer to the first question is YES, than how can I get the url of that extra repository? Here is the reference to maven dependency.
Error:
[ERROR] Plugin com.google.protobuf.tools:maven-protoc-plugin:0.3.2 or one of its dependencies could not be resolved: Failure to find com.google.protobuf.to ols:maven-protoc-plugin:jar:0.3.2 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the u pdate interval of central has elapsed or updates are forced -> [Help 1] org.apache.maven.plugin.PluginResolutionException: Plugin com.google.protobuf.tools:maven-protoc-plugin:0.3.2 or one of its dependencies could not be resol ved: Failure to find com.google.protobuf.tools:maven-protoc-plugin:jar:0.3.2 in http://repo.maven.apache.org/maven2 was cached in the local repository, res olution will not be reattempted until the update interval of central has elapsed or updates are forced ....... Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.google.protobuf.tools:maven-protoc-plugin:jar:0.3.2 in http://rep o.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or update s are forced
pom.xml:
<?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>groupId</groupId> <artifactId>JavaSockets</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>2.5.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>com.google.protobuf.tools</groupId> <artifactId>maven-protoc-plugin</artifactId> <version>0.3.2</version> <configuration> <protocExecutable>C:\Users\Clasik\Desktop\Java Sockets</protocExecutable> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> ...... Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.google.protobuf.tools:maven-protoc-plugin:jar:0.3.2 in http://repo.ma ven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates ar e forced ...............
-
lefloh about 10 yearsThere you will only find version 0.1.10. The configured version 0.3.2 is coming from this fork
-
VB_ about 10 years@lefloh as I understand you propose to change
pluginRepository
definition. May you provide your version in separate answer please? -
lefloh about 10 yearsI already answered. But problem is that the maven-repository for the fork seems to be down.
-
VB_ about 10 yearsshould I include some proto buffers' sources besides plugin\dependencies definition in pom.xml? When I try
mvn clean install
I getcannot find symbol
errors, likeMessageOrBuilder
,Parser
etc. As I understand that are protocol buffer libraries -
lefloh about 10 yearsAre you working with dtrott’s or ivanov’s version now? Please compare with the according documentation. Dtrott is using protobuf-java in Version 2.3.0 for instance. Maybe 2.5.0 brought incompatible changes. (Just a guess…)
-
VB_ about 10 yearsI've already switched to ivanov version. What should I do. May be it'll be better if I post my demo on GitHub and you'll what is going wrong?
-
lefloh about 10 yearsSorry, I’ve no idea what this plugin is doing. I just could tell you why maven didn’t find the plugin.
-
dwb about 10 yearsFor anyone else that comes across this, the <pluginRepositories>...</pluginRepositories> snippet in answer does work even though you get a 404 when trying to access it with a browser.