从maven 2升级到maven 3 [英] Upgrading to maven 3 from maven 2

查看:333
本文介绍了从maven 2升级到maven 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have upgraded from Maven 2 to Maven 3 and it seems to be working fine to clean install.

然而,在 Maven 3.x兼容性说明,提到不再支持< reporting> 标记,应该移动直到< build> 标记。

However, in the Maven 3.x Compatibility Notes, it is mentioned that the <reporting> tag is no longer supported and should be moved up to the <build> tag.

<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> 标记。


I have commented this out and moved the plugin tag and its content, to the <build><plugins> tag.

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

When I run mvn validate now, I get the following error:

[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]

我错过了什么吗?我可以把事情保留原样,但是我试着去试一试,但它没有用。

Am I missing something? I could just leave things as they are, but I gave it a try to move it, but it did not work.

推荐答案

尝试:

    <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>

(未经测试;我不确定reportSets-part)

(untested; I'm not sure about the reportSets-part)

这篇关于从maven 2升级到maven 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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