时间:2017-10-14 08:16:57

标签: maven-site-plugin

项目的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>

1 个答案:

答案 0 :(得分:2)

好吧,我看到我没有清楚地解释“做什么”:我会看看我是否可以改进下一个Maven版本的消息

您需要使用“经典配置(Maven 2&amp; 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> 

节点并将maven-site-plugin更新为新版本 - 此时为3.6