2

With Maven 3, the site plugin has changed regarding reporting.

In the maven 2, the reporting section had the an "inherited" element. For example:

<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-failsafe-plugin</artifactId>
      <version>${failsafe.plugin.version}</version>
      <configuration>
        <useFile>false</useFile>
      </configuration>
      <inherited>true</inherited>
      <reportSets>
        <reportSet>
          <reports>
            <report>report-only</report>
          </reports>
        </reportSet>
      </reportSets>
    </plugin>
  </plugins>
</reporting>

Does report plugin inheritance exist in Maven 3? So in maven 3 what is the inheritance behavior for reportPlugins and is there any way to change this behavior like the maven 2 inherited element?

Secondly, does the section have any affect on plugin configurations in the reportPlugins under the site plugin? Or do configurations have to be duplicated in pluginManagement & reportPlugins sections? Does any of this configuration also have to be duplicated in submodules?

At the end of the day I'd like to do something like the following in Maven 3:

<!-- in parent pom -->
<build>
  <pluginManagement>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-failsafe-plugin</artifactId>
      <version>${failsafe.plugin.version}</version>
      <configuration>
        <useFile>false</useFile>
      </configuration>
      <reportSets>
        <reportSet>
          <reports>
            <report>report-only</report>
          </reports>
        </reportSet>
      </reportSets>
    </plugin>
  </pluginManagement>

  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-failsafe-plugin</artifactId>
      <!-- no version num or config - specified in pluginManagement section -->
    </plugin>  

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <!-- no version num, config, or report set - specified in pluginManagement section -->
            </plugin>  
          </reportPlugins>
        </configuration>
      </plugin>
  </plugins>
</build>

<!-- in sub module pom -->
<!-- specify nothing - already in parent pom-->

And I would like all of these configurations to be inherited to submodules. Even the reportPlugins section.

Is any/all of this possible with maven 3 currently?

Travis Schneeberger
  • 2,010
  • 20
  • 23
  • Possible duplicate of [Is there a way for a Maven project to inherit report configurations from a pom dependency?](https://stackoverflow.com/questions/4466736/is-there-a-way-for-a-maven-project-to-inherit-report-configurations-from-a-pom-d) – hoijui Jan 20 '19 at 19:02

1 Answers1

3

It looks like this may not be completely possible. Refer to this issue in the maven-site-plugin.

It is supposedly now working just like you wanted back then, since Maven 3.5, released in 2017.

hoijui
  • 3,615
  • 2
  • 33
  • 41
Raghuram
  • 51,854
  • 11
  • 110
  • 122