【问题标题】:Can't build Guava using Maven "mvn package"无法使用 Maven “mvn package”构建 Guava
【发布时间】:2011-10-11 10:41:50
【问题描述】:

我刚刚阅读了 Guava 并查看了它的源代码,但不知道如何构建它以供使用。我使用“mvn package”构建了 jar 文件,但它会产生 Guava GWT 的错误。

[ERROR] Failed to execute goal on project guava-gwt: Could not resolve dependenc
ies for project com.google.guava:guava-gwt:jar:latest: Failure to find com.googl
e.guava:guava:jar:sources:latest in http://repo1.maven.org/maven2 was cached in
the local repository, resolution will not be reattempted until the update interv
al of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

【问题讨论】:

    标签: maven-3 guava


    【解决方案1】:

    您可能需要先运行“mvn install”,正如 Charles Fry 在这里解释的那样:

    http://groups.google.com/group/guava-discuss/browse_thread/thread/aac1ec01dc09f363

    我们有一个有趣的设置,你必须使用 'mvn 来构建东西 在其他明显的东西起作用之前安装'。


    如果您不关心 TRUNK,也可以使用 Maven 依赖项依赖最新版本:

    is guava-libraries available in maven repo?

    【讨论】:

    • 现在我收到此错误:[错误] 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2。 7.2:test (default-test) on project guava-tests: 有测试失败。 [ERROR] [ERROR] 个别测试结果请参考 D:\Guava\guava-tests\target\surefire-reports。
    • target/surefire-reports 的内容是什么?这可能会为我们提供有关问题的线索。 Guava 测试套件最近开源,从 TRUNK 构建时测试有时会失败(在这种情况下,我们将在 Guava 跟踪器上打开一个问题)。您现在可以执行“mvn clean install -Dmaven.test.skip”来忽略测试。也就是说,您确定要依赖 TRUNK 而不是最新版本的 jar?
    • 好的,我将下载并使用release jar,而不是使用trunk。 Guava-r09 已弃用,但我认为可以使用。
    • 是的,guava r09 很好,很稳定。 r10 有一些不错的新功能,但如果你不需要它们,你就必须使用它们。
    猜你喜欢
    • 1970-01-01
    • 2018-02-12
    • 1970-01-01
    • 2019-06-28
    • 2016-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-26
    相关资源
    最近更新 更多