首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven ArtifactNotFoundException故障排除

Maven ArtifactNotFoundException故障排除
EN

Stack Overflow用户
提问于 2014-04-21 07:52:14
回答 3查看 13.7K关注 0票数 2

问题:--我正在尝试使Google缓冲区依赖项工作。但没有结果。Maven只是无法提取任何协议缓冲区依赖项。

Question1:Question1:据我所知,标准maven存储库中不存在这种依赖关系,因此我只需要指出一些额外的存储库。我说的对吗?

Question2:如果对第一个问题的回答是肯定的,那么我如何才能获得额外存储库的url呢?这里是对maven依赖项的引用。

错误:

代码语言:javascript
复制
[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:

代码语言:javascript
复制
<?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   
  ...............
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-04-21 08:23:25

缺少的依赖项是maven-plugin,而不是protobuf。这个插件是无法在Maven Central获得

根据它的作者,您可以向pom.xml添加一个自托管存储库:

代码语言:javascript
复制
<pluginRepositories>
    <pluginRepository>
        <id>protoc-plugin</id>
        <url>http://sergei-ivanov.github.com/maven-protoc-plugin/repo/releases/</url>
    </pluginRepository>
</pluginRepositories>

但我在这里只得到404。因此,您可以与作者联系,或者查看源代码,并在本地存储库中手动安装插件。

票数 2
EN

Stack Overflow用户

发布于 2014-04-21 08:20:02

解决方案是添加插件存储库:

代码语言:javascript
复制
<pluginRepositories>
    <pluginRepository>
        <id>dtrott</id>
        <url>http://maven.davidtrott.com/repository</url>
    </pluginRepository>
</pluginRepositories>
票数 0
EN

Stack Overflow用户

发布于 2016-09-01 12:22:30

这个插件的旧版本可以从Bintray获得:

代码语言:javascript
复制
<pluginRepositories>
  <pluginRepository>
    <id>protoc-plugin</id>
    <url>https://dl.bintray.com/sergei-ivanov/maven</url>
  </pluginRepository>
</pluginRepositories>

我能够使用这个插件库获得0.3.2版本,这个插件库是在项目自述文件中链接到的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23193224

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档