在资源库中央找不到资源(http://repo1.maven.org/maven2) [英] Unable to find resource in repository central (http://repo1.maven.org/maven2)

查看:67
本文介绍了在资源库中央找不到资源(http://repo1.maven.org/maven2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我该怎么做才能解决在Maven仓库中找不到的资源,是否可以向pom.xml添加其他仓库清单?我尝试将解决方案列为命令行,但即使maven报告它为成功,它也无法正常工作.

In General, what do i do to resolve resource not found in a maven repo, is there another list of repos i can add to pom.xml ? i tried the solution listed as command line, but it did not work, even though maven reported it as being SUCCESS.

I tried to build test-analytics, but got error:

[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
Downloading: http://repo1.maven.org/maven2/com/google/code/gwt-dnd/gwt-dnd/3.1.1/gwt-dnd-3.1.1.pom
[INFO] Unable to find resource 'com.google.code.gwt-dnd:gwt-dnd:pom:3.1.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/com/google/code/gwt-dnd/gwt-dnd/3.1.1/gwt-dnd-3.1.1.jar
[INFO] Unable to find resource 'com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.google.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.google.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) com.google.testing.testify.risk.frontend:test-analytics:war:1.0-SNAPSHOT
    2) com.google.code.gwt-dnd:gwt-dnd:jar:3.1.1

----------
1 required artifact is missing.

for artifact: 
  com.google.testing.testify.risk.frontend:test-analytics:war:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Nov 18 21:24:23 EST 2012
[INFO] Final Memory: 16M/238M
[INFO] ------------------------------------------------------------------------

这是命令和错误:

 mvn deploy:deploy-file -DgroupId=com.google.code.gwt-dnd -DartifactId=gwt-dnd -Dversion=3.1.1 -Dpackaging=jar -Dfile=gwt-dnd-3.1.1.jar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'deploy'.
[INFO] ------------------------------------------------------------------------
[INFO] Building test-analytics
[INFO]    task-segment: [deploy:deploy-file] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for 'deploy:deploy-file'

[0] Inside the definition for plugin 'maven-deploy-plugin' specify the following:

<configuration>
  ...
  <url>VALUE</url>
</configuration>

-OR-

on the command line, specify: '-Durl=VALUE'

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Nov 20 14:10:37 EST 2012
[INFO] Final Memory: 14M/238M
[INFO] ------------------------------------------------------------------------

推荐答案

您缺乏对Maven世界的一些基本了解.因此,简短的repos摘要应该会为您提供帮助.

You are lacking in some fundamental understanding of the Maven world. So, a brief summary of repos should help you.

对于初学者,当您开箱即用"运行maven时,有两个可用的存储库,这是您已经完成的工作.您有1)Maven Central和2)您的本地仓库,即〜/.m2/repository.本地存储库是一种缓存,您在本地构建的工件的位置将通过"mvn install"命令安装"到.注意,"mvn deploy"命令部署"工件,就像安装一样,但是它意味着将工件放入远程存储库"中. Maven Central是一个远程存储库,除了单个本地存储库以外,所有存储库都是远程存储库,但是您不会轻易地部署到它.用于经过审查的,发布质量的工件.

For starters, there are two repositories available when you run maven "out of the box", wich is what you have done. You have 1) maven central and 2) your local repo, i.e. ~/.m2/repository. The local repository is a sort of cache and the place that artifacts you build locally will be "installed" to via the "mvn install" command. Note, the "mvn deploy" command "deploys" an artifact, which is like an install but it means to put the artifact into a "remote repository". Maven Central is a remote repository, as are all repos except for your single local repo, but you don't deploy to it willy nilly. It's for vetted, release quality artifacts.

因此,您的版本找不到google工件.这意味着它们不在Maven Central中,尽管您可以检查. http://search.maven.org/

So, your build couldn't find the google artifacts. This means that they aren't in Maven Central, though you can check. http://search.maven.org/

如果不存在,则有几种选择.

If they aren't there you have a few options.

1)安装"本地仓库中的工件(这是您的第一步,因为它非常轻巧)

1) "install" the artifacts in your local repo ( this should be your first step since it's extremely lightweight )

2)运行您自己的存储库服务器,例如nexus.这是您自己的远程存储库",您可以将Google东西部署"到它.

2) run your own repository server, such as nexus. This is your own "remote repository", and you can "deploy" the google stuff to it.

3)找出google内容是否在另一个可公开访问的远程存储库中-有一些重要的内容不在现成的maven存储库定义中,但是您可以添加它们.

3) find out if the google stuff is in another publicly available remote repository -- there are several important ones that aren't in the out of the box maven repo definitions, but you can add them.

请注意,这三个选项并不能作为解决不同情况的替代方案.如果您只是在尖刺或摆弄东西,我肯定会使用#1.如果您要进行认真的开发工作以使用这些工件,则必须至少执行#3,并且可能至少执行#2.如果您真的要大量使用Maven,则#2对于简化您的生活至关重要.从概念上讲,大多数行家都假设您拥有自己的回购服务器,这也是一种很棒的教育经验.

Note, these three options aren't so much alternatives as solutions for different situations. If you are just spiking or poc'ing something, I'd go with number #1 for sure. If you are setting up a serious development effort that will use those artifacts, you must do at least #3 and probably #2; #2 is critical to making your life easier if you are really going to be making heavy use of maven. It's also a great educational experience as most of the maven stuff kind of assumes, conceptually, that you have your own repo server.

这篇关于在资源库中央找不到资源(http://repo1.maven.org/maven2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆