项目的 maven 构建 https://github.com/BITPlan/com.bitplan.antlr
给出警告信息:
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.bitplan.antlr:com.bitplan.antlr:jar:0.0.1
[WARNING] Reporting configuration should be done in <reporting> section, not in maven-site-plugin <configuration> as reportPlugins parameter. @ line 213, column 20
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
由于下面几行中的 maven-site-plugin 配置。不幸的是,没有指向如何正确执行此操作的示例的指针,我还无法在 stackoverflow 中或通过搜索引擎找到一个示例。
我找到的链接是:
但我无法弄清楚这对于消除警告意味着什么。
原问题:
使警告消失的必要修改是什么?
在第一个回答后添加评论:
当我移动
<plugins>
...
</plugins>
来自配置节点内部的部分
的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
...
</configuration>
</plugin>
到一个单独的
<reporting>
...
</reporting>
节点
我收到错误消息:
Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed:
A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.0:site:
org/sonatype/aether/graph/DependencyFilter
将站点插件版本更新到 3.6 解决了这个问题。
相关的 pom.xml 行
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<!-- configuration of reports to be included in site -->
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.2</version>
<configuration>
<dependencyDetailsEnabled>true</dependencyDetailsEnabled>
<dependencyLocationsEnabled>true</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<overview>${basedir}\src\main\java\overview.html</overview>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.6</version>
</plugin>
<!-- http://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.13</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
最佳答案
好的,我看到我没有清楚地解释“要做什么”:我会看看我是否可以改进下一个 Maven 版本的消息
您需要使用“经典配置(Maven 2 和 3)”而不是“新配置(仅限 Maven 3)”:参见 http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Configuration_formats
你需要移动
<reportPlugins>
...
</reportPlugins>
部分来自内部配置节点:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
...
</configuration>
</plugin>
到一个单独的
<reporting>
<plugins>
...
</plugins>
</reporting>
node 并将 maven-site-plugin 更新为新版本 - 此时为 3.6
关于maven-site-plugin - 建立有效模型时遇到的一些问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46742407/