gpt4 book ai didi

java - 从 maven 2 升级到 maven 3

转载 作者:行者123 更新时间:2023-11-30 05:53:34 25 4
gpt4 key购买 nike

我已经从 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]

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

最佳答案

尝试:

    <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 部分)

关于java - 从 maven 2 升级到 maven 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10413339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com