1

问候所有我在我的 spring 项目中使用 maven 2 以及当我尝试使用命令从终端构建项目时 (mvn clean-mvn install)

它无法从任何 repos 下载任何依赖项,而且我总是得到如下信息:

Downloading: http://repo1.maven.org/maven2/velocity-tools/velocity-tools-generic/1.4/velocity-tools-generic-1.4.pom
[INFO] Unable to find resource 'velocity-tools:velocity-tools-generic:pom:1.4' in repository first (http://repo1.maven.org/maven2)
Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2//velocity-tools/velocity-tools-generic/1.4/velocity-tools-generic-1.4.pom
[INFO] Unable to find resource 'velocity-tools:velocity-tools-generic:pom:1.4' in repository second (http://mirrors.ibiblio.org/pub/mirrors/maven2/)
Downloading: http://repository.jboss.com/maven2//velocity-tools/velocity-tools-generic/1.4/velocity-tools-generic-1.4.pom
[INFO] Unable to find resource 'velocity-tools:velocity-tools-generic:pom:1.4' in repository jboss (http://repository.jboss.com/maven2/)
Downloading: http://maven.jahia.org/maven2/velocity-tools/velocity-tools-generic/1.4/velocity-tools-generic-1.4.pom
[INFO] Unable to find resource 'velocity-tools:velocity-tools-generic:pom:1.4' in repository additional (http://maven.jahia.org/maven2)
Downloading: http://208.79.234.53:8081/artifactory/libs-releases-local/velocity-tools/velocity-tools-generic/1.4/velocity-tools-generic-1.4.pom
[WARNING] Unable to get resource 'velocity-tools:velocity-tools-generic:pom:1.4' from repository host.varaza.com (http://208.79.234.53:8081/artifactory/libs-releases-local): Error transferring file: Connection timed out

任何想法,为什么会发生这样的事情?

4

4 回答 4

3

从存储库链接看来,这dependency似乎没有关联pom文件。这就是警告的原因。

通常,存储库中的依赖项也有一个 pom 文件,该文件描述项目并指定其依赖项。Maven 首先下载这个 pom 文件,以便它可以解析传递依赖(如果有)。

于 2011-02-10T08:55:57.360 回答
3

Maven只是试图pom从您的存储库中获取文件,并且只要它无法下载它们就会尝试。

这很可能是因为您引用的库(依赖项)pom在任何可用的远程存储库中都没有文件。这可能是正常的。

但是,如果您想摆脱该消息,您可以在公司的存储库中为这些依赖项部署最少的文件。 pom您可以选择仅在本地安装它们,但您团队中的其他开发人员仍会收到这些消息。

于 2011-02-10T17:42:30.687 回答
2

Maven 无法访问依赖项所在的站点。

尝试运行

ping repo1.maven.org

或在您的网络浏览器中打开它。也许您应该设置防火墙以允许 Maven 从 Internet 下载内容。

于 2011-02-10T08:41:34.443 回答
1

我使用了以下依赖项 - 对我有用。

<dependency>
    <groupId>velocity-tools</groupId>
    <artifactId>velocity-tools-generic</artifactId>
    <version>1.4</version>
</dependency>
于 2011-02-10T08:39:48.987 回答