我已经从Maven 2升级到了Maven 3,它在clean install上运行得很好。
但是,在Maven 3.x兼容性说明中,需要指出的是,<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]我是不是遗漏了什么?我可以把它们留在原样上,但我试着移动它,但它不起作用。
发布于 2012-05-02 12:24:18
尝试:
<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-02 12:15:40
这不仅仅是将标签复制到另一个地方的问题。模式在其他方面也发生了变化。
我建议您阅读"Maven 3仅限“配置的文档,因为这似乎是您想要做的。这是一个链接。
https://stackoverflow.com/questions/10413339
复制相似问题