为什么Maven不生成项目报告? [英] Why maven doesn't generate project reports?

查看:63
本文介绍了为什么Maven不生成项目报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是Maven 3.0.我正在创建一个新项目:

It's Maven 3.0. I'm creating a new project:

mvn archetype:create

然后我正在创建文件site/site.xml:

<project name="foo">
  <body>
    <menu name="Overview">
      <item name="Introduction" href="index.html" />
    </menu>
    <menu ref="reports" />
  </body>
</project>

然后我将报表插件添加到pom.xml:

Then I'm adding a reporting plugin to pom.xml:

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.1.1</version>
    </plugin>
  </plugins>
</reporting>

然后我运行mvn site并说"BUILD SUCCESS".但是我在项目站点中没有看到任何报告(报告菜单项不存在).我在做什么错了?

Then I run mvn site and it says "BUILD SUCCESS". But I don't see any reports in project site (reporting menu item is not there). What am I doing wrong?

推荐答案

Maven 3报告不一样.

Maven 3 reporting is different.

[...]
<build>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <version>3.0-beta-2</version>
    <configuration>
      <reportPlugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.2</version>
          <reports>
            <report>cim</report>
            <report>issue-tracking</report>
          </reports>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.2</version>
        </plugin>
      </reportPlugins>
    </configuration>
  </plugin>
</build>
[...]

这篇关于为什么Maven不生成项目报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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