Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      maven-site-plugin 2.0-beta-3-SNAPSHOT
    • Number of attachments :
      0

      Description

      Consider the following POM:

      <!-- ... ... -->
      <!-- ... ... -->
      <build>
          <pluginManagement>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <configuration>
                  <author>false</author>
                  </configuration>
              </plugin>
          </pluginManagement>
      </build>
      <!-- ... ... -->
      <!-- ... ... -->
      <reporting>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
              </plugin>
          </plugins>
      </reporting>
      <!-- ... ... -->
      

      mvn site:site doesn't honor the javadoc configuration specified in the <pluginManagement/> section.
      However, mvn javadoc:javadoc honors them.

      This is true not just for javadoc but other plugins like checkstyle as well.

      I guess, the <reporting/> section doesn't use the <pluginManagement/> section at all.

        Issue Links

          Activity

          Hide
          Indrajit Raychaudhuri added a comment -

          This might be related to MNG-1855 but it has been raised for checkstyle-plugin module. It's true for other plugins as well.

          Show
          Indrajit Raychaudhuri added a comment - This might be related to MNG-1855 but it has been raised for checkstyle-plugin module. It's true for other plugins as well.
          Hide
          Brett Porter added a comment -

          not really related to mng-1855

          Show
          Brett Porter added a comment - not really related to mng-1855
          Hide
          Brett Porter added a comment -

          this is a design issue... do we need a reportingManagement element?

          Show
          Brett Porter added a comment - this is a design issue... do we need a reportingManagement element?
          Hide
          Indrajit Raychaudhuri added a comment -

          Is there a way to make site reporting honor plugin config in <build/>?

          We can have a <reportingManagement/> element to config reporting as such.
          But then we would land up in a situation where certain configurations have to be repeated in <pluginManagement/> as well as <reportingManagement/>.

          The solution would serve the purpose but won't be as elegent

          Show
          Indrajit Raychaudhuri added a comment - Is there a way to make site reporting honor plugin config in <build/>? We can have a <reportingManagement/> element to config reporting as such. But then we would land up in a situation where certain configurations have to be repeated in <pluginManagement/> as well as <reportingManagement/>. The solution would serve the purpose but won't be as elegent
          Hide
          Brett Porter added a comment -

          It's intentionally the other way around.

          settings in reporting are already applied to build plugins so they don't need to be duplicated, but build plugins have a more honerous requirement - specifically they will often fail the build when the reporting plugin won't during site generation. For this reason, build configuration is not passed to the reports.

          Show
          Brett Porter added a comment - It's intentionally the other way around. settings in reporting are already applied to build plugins so they don't need to be duplicated, but build plugins have a more honerous requirement - specifically they will often fail the build when the reporting plugin won't during site generation. For this reason, build configuration is not passed to the reports.
          Hide
          Indrajit Raychaudhuri added a comment -

          Wonderful!

          So the <reportingManagement/> idea in action_53690 actually makes sense to me now and appears clean enough too.

          This also appears to be a candidate for docu. somewhere (maybe in maven-model) specifying the distinction between <build><pluginManagement/></build> and <reportingManagement/> and what should go where (as part of best-practice).

          Show
          Indrajit Raychaudhuri added a comment - Wonderful! So the <reportingManagement/> idea in action_53690 actually makes sense to me now and appears clean enough too. This also appears to be a candidate for docu. somewhere (maybe in maven-model) specifying the distinction between <build><pluginManagement/></build> and <reportingManagement/> and what should go where (as part of best-practice).
          Hide
          John Allen added a comment -

          Any thoughts re moving this up the priority ladder? After all one of the key benefits of using maven is the reduction in duplicated configs and currently I am not able to share any of my reporting settings across projects.

          Additionally re reporting plugin configs affecting build plugin settings.

          I uses a number of plugins for both reporting and compliance/governance checks, currently javadoc warnings, pmd, checkstyle and test coverage. I would like to be able to run reporting against one set of configs and have build uses others. Ie. reporting tends to use quite a harsh set of rules for PMD/Checkstyle whereas my compliance build (which fails the build if a governance setting is not met) uses a more relxed config. How can i achieve this separation on configs for plugins that are used in both reporting and build?

          Show
          John Allen added a comment - Any thoughts re moving this up the priority ladder? After all one of the key benefits of using maven is the reduction in duplicated configs and currently I am not able to share any of my reporting settings across projects. Additionally re reporting plugin configs affecting build plugin settings. I uses a number of plugins for both reporting and compliance/governance checks, currently javadoc warnings, pmd, checkstyle and test coverage. I would like to be able to run reporting against one set of configs and have build uses others. Ie. reporting tends to use quite a harsh set of rules for PMD/Checkstyle whereas my compliance build (which fails the build if a governance setting is not met) uses a more relxed config. How can i achieve this separation on configs for plugins that are used in both reporting and build?
          Hide
          Brett Porter added a comment -

          this is as high up the priority ladder as it goes. no pom additions until 2.1, sorry.

          Show
          Brett Porter added a comment - this is as high up the priority ladder as it goes. no pom additions until 2.1, sorry.
          Hide
          Denis Cabasson added a comment -

          In relation with MNG-1855:

          when using a report plugin needing a dependency (
          checkstyle, set as in:
          http://maven.apache.org/plugins/maven-checkstyle-plugin/tips.html, ont sure this example is working, but no time to test it, sorry.)

          extra jars need to be added to classpath. It's not possible right now, cause report part has no dependencies child.

          Maybe plan to add this to reportManagement?

          Show
          Denis Cabasson added a comment - In relation with MNG-1855 : when using a report plugin needing a dependency ( checkstyle, set as in: http://maven.apache.org/plugins/maven-checkstyle-plugin/tips.html , ont sure this example is working, but no time to test it, sorry.) extra jars need to be added to classpath. It's not possible right now, cause report part has no dependencies child. Maybe plan to add this to reportManagement?
          Hide
          Rory Winston added a comment -

          It would be nice to be able to add custom taglets to a classpath used just for reporting, for instance

          Show
          Rory Winston added a comment - It would be nice to be able to add custom taglets to a classpath used just for reporting, for instance
          Hide
          Thomas Demande added a comment -

          Quite painful in combination with MJAVADOC-268, where it's needed to be able to force a version.

          Show
          Thomas Demande added a comment - Quite painful in combination with MJAVADOC-268 , where it's needed to be able to force a version.
          Hide
          Jason van Zyl added a comment -

          Now the site plugin's use case.

          Show
          Jason van Zyl added a comment - Now the site plugin's use case.
          Hide
          Dennis Lundberg added a comment -

          Jason,

          If this the issue of moving all reporting plugins configuration into the Site Plugin? Is this a requirement for Maven 3? Would it be possible to make this work for Maven 2.1+ as well?

          Show
          Dennis Lundberg added a comment - Jason, If this the issue of moving all reporting plugins configuration into the Site Plugin? Is this a requirement for Maven 3? Would it be possible to make this work for Maven 2.1+ as well?
          Hide
          Sven Ludwig added a comment -

          I want to add an idea how to solve this issue. It could be done by offering a new boolean property in the reporting section like "honorPluginManagement". Default should be false, but if it is set to true, the plugins in the reporting section would use the respective configurations in pluginManagement. It should then also be possible to override pluginManagement settings in the reporting section. Moreover, it should work no matter if the reporting section is in the same pom as the pluginManagement section, or if it is further down the inheritance tree. At least from my current personal perspective, this would be a good solution.

          I can see however that some people may want a separate pluginManagement-like section within the reporting section.

          Show
          Sven Ludwig added a comment - I want to add an idea how to solve this issue. It could be done by offering a new boolean property in the reporting section like "honorPluginManagement". Default should be false, but if it is set to true, the plugins in the reporting section would use the respective configurations in pluginManagement. It should then also be possible to override pluginManagement settings in the reporting section. Moreover, it should work no matter if the reporting section is in the same pom as the pluginManagement section, or if it is further down the inheritance tree. At least from my current personal perspective, this would be a good solution. I can see however that some people may want a separate pluginManagement-like section within the reporting section.
          Hide
          Anthony Whitford added a comment -

          I like Sven's idea. Ultimately, I am looking for a way to say, "Use javadoc 2.8" once – this should affect both the <build> and <reporting> sections, otherwise my pom violates the DRY principle.

          Show
          Anthony Whitford added a comment - I like Sven's idea. Ultimately, I am looking for a way to say, "Use javadoc 2.8" once – this should affect both the <build> and <reporting> sections, otherwise my pom violates the DRY principle.
          Hide
          Diwaker Gupta added a comment -

          This major bug has been open for 7 years now. There seems be enough community support for this feature. The Maven developers should either mark this as won't fix or fix it for real, rather than let it linger in limbo forever.

          Show
          Diwaker Gupta added a comment - This major bug has been open for 7 years now. There seems be enough community support for this feature. The Maven developers should either mark this as won't fix or fix it for real, rather than let it linger in limbo forever.
          Hide
          Herve Boutemy added a comment -

          this is fixed in Maven 3 + maven-site-plugin-3

          see explanations

          Show
          Herve Boutemy added a comment - this is fixed in Maven 3 + maven-site-plugin-3 see explanations
          Hide
          Jin Kwon added a comment - - edited

          I just find that maven-site-plugin seems have some problem although works as explained on http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Version_Resolution.

          <build>
            <pluginManagement>
              <plugins>
                <plugin>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <version>2.8.1</version>                                 <----------------| must follow the lights; it doesn't.              
                </plugin>                                                                   |
                <plugin>                                                                    |
                  <artifactId>maven-site-plugin</artifactId>                                |
                  <version>3.1</version>                                                    |
                </plugin>                                                                   |
              </plugins>                                                                    |
            </pluginManagement>                                                             |
            <plugins>                                                                       |
              <plugin>                                                                      |
                <artifactId>maven-javadoc-plugin</artifactId> <------------| 2.7 -----------|
              </plugin>                                                    |
              <plugin>                                                     |
                <groupId>org.apache.maven.plugins</groupId>                |
                <artifactId>maven-site-plugin</artifactId>                 |
                <executions>                                               |
                  <execution>                                              |
                    <id>attach-descriptor</id>                             |
                    <goals>                                                |
                      <goal>attach-descriptor</goal>                       |
                    </goals>                                               |
                  </execution>                                             |
                </executions>                                              |
                <configuration>                                            |
                  <reportPlugins>                                          |
                    <plugin>                                               |
                      <artifactId>maven-javadoc-plugin</artifactId> -------|
                    </plugin>
                  </reportPlugins>
                </configuration>
              <plugin>
            </plugins>
          </build>
          
          Show
          Jin Kwon added a comment - - edited I just find that maven-site-plugin seems have some problem although works as explained on http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Version_Resolution . <build> <pluginManagement> <plugins> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.8.1</version> <----------------| must follow the lights; it doesn't. </plugin> | <plugin> | <artifactId>maven-site-plugin</artifactId> | <version>3.1</version> | </plugin> | </plugins> | </pluginManagement> | <plugins> | <plugin> | <artifactId>maven-javadoc-plugin</artifactId> <------------| 2.7 -----------| </plugin> | <plugin> | <groupId>org.apache.maven.plugins</groupId> | <artifactId>maven-site-plugin</artifactId> | <executions> | <execution> | <id>attach-descriptor</id> | <goals> | <goal>attach-descriptor</goal> | </goals> | </execution> | </executions> | <configuration> | <reportPlugins> | <plugin> | <artifactId>maven-javadoc-plugin</artifactId> -------| </plugin> </reportPlugins> </configuration> <plugin> </plugins> </build>
          Hide
          Jörg Sesterhenn added a comment - - edited

          Please reopen this issue.

          With reintroduction of the "classic" reporting configuration in maven-site-plugin 3.3 due to MSITE-684 as described here, there has been a regression. Although I define the versions of all my report-plugins in plugin-management maven says:

          [WARNING] Some problems were encountered while building the effective model for de.seu.maven:MyParentPOM:pom:1.2.2-SNAPSHOT
          [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:clirr-maven-plugin is missing. @ line 364, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ line 368, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 372, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. @ line 376, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.sonar-plugins:maven-report is missing. @ line 380, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-changes-plugin is missing. @ line 384, column 15
          [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-dependency-plugin is missing. @ line 414, column 15

          I second the vote for a plugin-management inside of <reporting>: That way maven could choose to resolve report-plugins only if site generation is triggered.

          I am using maven 3.0.5 and maven-site-plugin 3.3.

          Show
          Jörg Sesterhenn added a comment - - edited Please reopen this issue. With reintroduction of the "classic" reporting configuration in maven-site-plugin 3.3 due to MSITE-684 as described here , there has been a regression. Although I define the versions of all my report-plugins in plugin-management maven says: [WARNING] Some problems were encountered while building the effective model for de.seu.maven:MyParentPOM:pom:1.2.2-SNAPSHOT [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:clirr-maven-plugin is missing. @ line 364, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ line 368, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 372, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. @ line 376, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.sonar-plugins:maven-report is missing. @ line 380, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-changes-plugin is missing. @ line 384, column 15 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-dependency-plugin is missing. @ line 414, column 15 I second the vote for a plugin-management inside of <reporting>: That way maven could choose to resolve report-plugins only if site generation is triggered. I am using maven 3.0.5 and maven-site-plugin 3.3.
          Hide
          Herve Boutemy added a comment -

          This (wrong) warning was removed in Maven 3.1.0-alpha-1
          See MNG-5477
          pluginManagement support is done by m-site-p, but this warning is done in Maven core, so there is no solution in the plugin but only by upgrading Maven version used

          Show
          Herve Boutemy added a comment - This (wrong) warning was removed in Maven 3.1.0-alpha-1 See MNG-5477 pluginManagement support is done by m-site-p, but this warning is done in Maven core, so there is no solution in the plugin but only by upgrading Maven version used
          Hide
          Jörg Sesterhenn added a comment -

          Thanks for the hint. Commented on MNG-5477.

          Show
          Jörg Sesterhenn added a comment - Thanks for the hint. Commented on MNG-5477 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Indrajit Raychaudhuri
            • Votes:
              86 Vote for this issue
              Watchers:
              83 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: