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

Report on dependency-management throws Exceptions using version range for dependency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.4
    • dependency-management
    • None
    • Maven 3.0.1, Java 6u23

    Description

      Given the following simple project:

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
      
        <groupId>foo</groupId>
        <artifactId>app</artifactId>
        <version>3.0-SNAPSHOT</version>
        <name>App</name>
      
        <build>
          <pluginManagement>
            <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0-beta-3</version>
      
                <configuration>
                  <reportPlugins>
                    <reportPlugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-project-info-reports-plugin</artifactId>
                      <version>2.3.1</version>
      
                      <reportSets>
                        <reportSet>
                          <reports>
                         <!--report>index</report>
                            <report>summary</report-->
                            <report>dependency-management</report>
                         <!--report>dependencies</report-->
                          </reports>
                        </reportSet>
                      </reportSets>
                    </reportPlugin>
                  </reportPlugins>
                </configuration>
              </plugin>
            </plugins>
          </pluginManagement>
        </build>
      
        <dependencyManagement>
          <dependencies>
            <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>[4.8,)</version>
              <scope>test</scope>
            </dependency>
          </dependencies>
        </dependencyManagement>
      
        <dependencies>
          <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
          </dependency>
        </dependencies>
      </project>
      

      mvn site throws an exception (although site is generated):

      [INFO] Error stacktraces are turned on.
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building App 3.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] --- maven-site-plugin:3.0-beta-3:site (default-site) @ app ---
      [INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.3.1
      [WARNING] No URL defined for the project - decoration links will not be resolved
      [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
      [INFO] Generating "Dependency Management" report    --- maven-project-info-reports-plugin:2.3.1
      [WARNING] Unable to create Maven project from repository.
      org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: Failure to find junit:junit:pom:[4.
      8,) in http://uk.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the updat
      e interval of UK has elapsed or updates are forced for project junit:junit:pom:[4.8,)
              at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:260)
              at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:237)
              at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:252)
              at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMavenProjectFromRepository(RepositoryUtil
      s.java:332)
              at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.getDependencyRow(Depen
      dencyManagementRenderer.java:219)
              at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForS
      cope(DependencyManagementRenderer.java:198)
              at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForA
      llScopes(DependencyManagementRenderer.java:149)
              at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderSectionProjectDe
      pendencies(DependencyManagementRenderer.java:140)
              at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderBody(DependencyM
      anagementRenderer.java:126)
              at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:79)
              at org.apache.maven.report.projectinfo.DependencyManagementReport.executeReport(DependencyManagementReport.java:
      115)
              at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
              at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:165)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:330)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:134)
              at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:159)
              at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:122)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451)
              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:134)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find junit:junit:pom:[4.8,) in http://
      uk.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of
      UK has elapsed or updates are forced
              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:499)
              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:187)
              at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:251)
              ... 37 more
      Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find junit:junit:pom:[4.8,) in http://uk.m
      aven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of UK h
      as elapsed or updates are forced
              at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:186)
      
              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:381)
              ... 39 more
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      
      

      while for example mvn dependency:list works properly.

      Note that for dependencies described with version ranges there are subdirectories created in my local repository like junit/junit/[4.8,) which wasn't the case with Maven 2.x !?

      Attachments

        1. pom.xml
          2 kB
          Benjamin Bentmann

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              fuege André Fügenschuh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: