You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/02/06 09:26:16 UTC

[maven-jxr] 02/02: [JXR-150] Remove calls to deprecated MavenProject.getReportPlugins()

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch JXR-150
in repository https://gitbox.apache.org/repos/asf/maven-jxr.git

commit a439639ef7879b911051c5bdbc26a5aeae425944
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Feb 6 10:22:04 2021 +0100

    [JXR-150] Remove calls to deprecated MavenProject.getReportPlugins()
---
 .../main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java
index c0520cc..ecde8e9 100644
--- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java
+++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJxrReport.java
@@ -26,7 +26,7 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -209,10 +209,10 @@ public abstract class AbstractJxrReport
     {
         // wanna know if Javadoc is being generated
         // TODO: what if it is not part of the site though, and just on the command line?
-        Collection<ReportPlugin> plugin = project.getReportPlugins();
-        if ( plugin != null )
+        if ( project.getModel().getReporting() != null )
         {
-            for ( ReportPlugin reportPlugin : plugin )
+            for ( ReportPlugin reportPlugin : Collections.unmodifiableList(
+                    project.getModel().getReporting().getPlugins() ) )
             {
                 if ( "maven-javadoc-plugin".equals( reportPlugin.getArtifactId() ) )
                 {