3

我已经从 Maven 2 升级到 Maven 3,它似乎可以正常工作到clean install.

但是,在Maven 3.x Compatibility Notes中,提到该<reporting>标签不再受支持,应该向上移动到该<build>标签。


<reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.1</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>dependencies</report>
              <report>dependency-convergence</report>
              <report>dependency-management</report>
              <report>index</report>
              <report>plugin-management</report>
              <report>project-team</report>
              <report>license</report>
              <report>summary</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>  

已将其注释掉并将插件标签及其内容移至<build><plugins>标签。

当我mvn validate现在运行时,我收到以下错误:

[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.company.projectName:ProjectName:1.2 (C:\Svn\projectName\branches\projectName-1.2\System\4_ImplementationSet\WAS\src\pom.xml) has 1 error
[ERROR]     Malformed POM C:\Svn\projectName\branches\projectName-1.2\System\4_ImplementationSet\WAS\src\pom.xml: Unrecognised tag: 'reportSets' (position: START_TAG seen ...</version>\r\n        <reportSets>... @123:21)  @ C:\Svn\projectName\branches\projectName-1.2\System\4_ImplementationSet\WAS\src\pom.xml, line 123, column 21 -> [Help 2]

我错过了什么吗?我可以让东西保持原样,但我试着移动它,但它没有用。

4

2 回答 2

3

这不仅仅是将标签复制到不同位置的问题。架构也在其他方面发生了变化。

我建议您阅读“仅限 Maven 3”配置的文档,因为这似乎是您想要做的。这是一个链接

于 2012-05-02T12:15:40.277 回答
3

尝试:

    <plugins>
       ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <reportPlugins> 
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.4</version>
                        <configuration>
                            <reportSets>
                                <reportSet>
                                    <reports>
                                        <report>dependencies</report>
                                        <report>dependency-convergence</report>
                                        <report>dependency-management</report>
                                        <report>index</report>
                                        <report>plugin-management</report>
                                        <report>project-team</report>
                                        <report>license</report>
                                        <report>summary</report>
                                    </reports>
                                </reportSet>
                            </reportSets>
                        </configuration>
                    </plugin>
                    ...
                </reportPlugins>
            </configuration>
        </plugin>
        ...
    </plugins>

(未经测试;我不确定报告集部分)

于 2012-05-02T12:24:18.357 回答