0

我们的项目团队想为我们的构建和 CI 从 ant 切换到 maven,所以我通过遵循 Sonatype “Maven By Example”一书来掌握它。

我正在使用 m2e,以及 m2e 安装的内部 maven。

我已经使用 maven-archetype-quickstart 创建了一个项目,并且没有以任何方式对其进行修改。它构建得很好,但是当我以.. 以目标“站点”运行时,我的项目的目标文件夹或我能找到的任何其他地方都不会产生任何内容。这是输出:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building quickstart 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-site-plugin:2.0.1:site (default-site) @ quickstart ---
Downloading: http://repo1.maven.org/maven2/org/apache/maven/skins/maven-default-   skin/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/skins/maven-default-skin/maven-metadata.xml (370 B at 2.0 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.759s
[INFO] Finished at: Fri May 25 08:46:54 BST 2012
[INFO] Final Memory: 10M/110M
[INFO] ------------------------------------------------------------------------

这是因为我使用的是内部 m2e Maven 吗?我需要单独安装maven吗?

4

1 回答 1

0

首先,根据我的经验,将外部 Maven 安装与 m2e 一起使用绝对是个好主意。我在使用嵌入式 Maven 时遇到了一些(其他类型的)麻烦,我不建议使用它。

现在关于您的问题:我不知道是 m2e 的嵌入式 Maven 还是您的某种错误或误解,但我刚刚使用相同的快速入门原型生成了简单的项目,一切正常。我有这样的输出:

    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building tester 1.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-site-plugin:3.0:site (default-site) @ tester ---
    [WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
    [WARNING]
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING]
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.4
    [INFO] Relativizing decoration links with respect to project URL: http://maven.apache.org
    [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
    [INFO] Generating "Distribution Management" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "About" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Issue Tracking" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Project Plugins" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Continuous Integration" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Project License" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Mailing Lists" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Project Team" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Source Repository" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Plugin Management" report    --- maven-project-info-reports-plugin:2.4
    [INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.4
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.046s
    [INFO] Finished at: Fri May 25 10:10:35 CEST 2012
    [INFO] Final Memory: 9M/28M
    [INFO] ------------------------------------------------------------------------

并且 - 正如预期的那样 - 网站是在target/site.

于 2012-05-25T08:13:33.210 回答