Uploaded image for project: 'Maven Project Info Reports Plugin'
  1. Maven Project Info Reports Plugin
  2. MPIR-386

Project building errors with plugins and central repository override

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.1.0
    • dependencies
    • None

    Description

      Seeing errors like the following during site generation:

      [ERROR] Unresolveable build extension: Plugin org.example:custom-extension:1.0.0 or one of its dependencies could not be resolved: Failure to find org.example:custom-extension:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ 
      [ERROR] Unknown packaging: custom-extension @ line 15, column 14
          at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:194)
          at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:329)
          at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMavenProjectFromRepository (RepositoryUtils.java:125)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printDescriptionsAndURLs (DependenciesRenderer.java:890)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printDependencyListing (DependenciesRenderer.java:847)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printDependencyListing (DependenciesRenderer.java:867)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyTree (DependenciesRenderer.java:486)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionProjectDependencyGraph (DependenciesRenderer.java:449)
          at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody (DependenciesRenderer.java:222)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.render (AbstractMavenReportRenderer.java:80)
          at org.apache.maven.report.projectinfo.DependenciesReport.executeReport (DependenciesReport.java:162)
          at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:251)
          at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:230)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:349)
          at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:198)
          at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:147)

      My projects are overriding the central repository (and pluginRepository) that come from the Super POM, but that appears not to be honored here.

       

      From what I can tell, the problem here is that the pluginArtifactRepositories are not set on the building request:

      https://github.com/apache/maven-project-info-reports-plugin/blob/ecdd72249300f64331b89bcd11ad3cdd253cf223/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java#L144

       

      When I add:

      buildingRequest.setPluginArtifactRepositories( remoteRepositories );
      

      The site generates without errors. However, I'm not sure that using remoteRepositories is appropriate here as I'm not sure exactly how those can be populated. Using project.getPluginArtifactRepositories() should also work.

       

      I can create the PR, I just wanted to get feedback on the correct fix first. I also see this same code in the DependencyManagementReport and assume the same fix may need to be applied there.

      Attachments

        Issue Links

          Activity

            People

              slachiewicz Sylwester Lachiewicz
              ewiegs4 Eddie Wiegers
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m