Maven Project Info Reports Plugin
  1. Maven Project Info Reports Plugin
  2. MPIR-238

Dependency File Details section of the dependencies report shows 'target/classes' for reactor artifacts.

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: dependency-info
    • Labels:
      None
    • Number of attachments :
      3

      Description

      Generating the dependencies report in a multi-module project leads to incorrect entries in the 'Dependency File Details' section of the dependencies report. For example, the Maven Release Plugin Dependency File Details report contains the following entry:

      Filename Size Entries Classes Packages JDK Rev Debug
      maven-release-manager/target/classes - 0 0 0 - release

      Building the site of a single module ('mvn site' in that modules directory), the correct entries are shown.

      1. MPIR-238.patch
        0.5 kB
        Christian Schulte
      2. MPIR-238-ReactorReader.patch
        2 kB
        Christian Schulte
      3. MPIR-238-ReactorReader.patch
        2 kB
        Christian Schulte

        Activity

        Hide
        Christian Schulte added a comment - - edited

        The cause is class 'org.apache.maven.ReactorReader' falling back to returning directories when the 'compile' phase has completed which is the case for various report plugins marked '@execute phase="generate-test-sources"'. MPIR-238.patch contains a patch for the dependencies report adding '@execute phase="package"' to make the reactor reader stop returning directories. MPIR-238-ReactorReader.patch contains a patch for that class to not resolve to directories when not executing the default lifecycle.

        Show
        Christian Schulte added a comment - - edited The cause is class 'org.apache.maven.ReactorReader' falling back to returning directories when the 'compile' phase has completed which is the case for various report plugins marked '@execute phase="generate-test-sources"'. MPIR-238 .patch contains a patch for the dependencies report adding '@execute phase="package"' to make the reactor reader stop returning directories. MPIR-238 -ReactorReader.patch contains a patch for that class to not resolve to directories when not executing the default lifecycle.
        Hide
        Christian Schulte added a comment -

        This also affects the 'Dependency Repository Locations' report, which does not link to snapshot repositories in such situations.

        Show
        Christian Schulte added a comment - This also affects the 'Dependency Repository Locations' report, which does not link to snapshot repositories in such situations.
        Hide
        Christian Schulte added a comment -

        Updated patch to test for the 'pre-clean' phase instead of 'clean'.

        Show
        Christian Schulte added a comment - Updated patch to test for the 'pre-clean' phase instead of 'clean'.
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.
        Hide
        Christian Schulte added a comment - - edited

        I think this issue should be taken care of. It maybe should be filed for Maven core since the cause of this issue really is a change in behaviour between Maven 2 and Maven 3. To summarize: In Maven 3, the core got changed to reference class files from e.g. the 'target/classes' directories in certain cases. This change stops maven from downloading artifacts from remote repositories. I think that method hasBeenPackaged of class ReactorReader should also check for the artifact to be available in some repository instead of just checking the package phase. The change I am requesting is to update method hasBeenPackaged in a way that it returns true, if the artifact being checked is found in a remote repository. For example:

        private boolean hasBeenPackaged( MavenProject project )
        {
          return project.hasLifecyclePhase( "package" )
              || project.hasLifecyclePhase( "install" )
              || project.hasLifecyclePhase( "deploy" )
              || project artifact can be resolved from a remote repository.
        }
        
        Show
        Christian Schulte added a comment - - edited I think this issue should be taken care of. It maybe should be filed for Maven core since the cause of this issue really is a change in behaviour between Maven 2 and Maven 3. To summarize: In Maven 3, the core got changed to reference class files from e.g. the 'target/classes' directories in certain cases. This change stops maven from downloading artifacts from remote repositories. I think that method hasBeenPackaged of class ReactorReader should also check for the artifact to be available in some repository instead of just checking the package phase. The change I am requesting is to update method hasBeenPackaged in a way that it returns true , if the artifact being checked is found in a remote repository. For example: private boolean hasBeenPackaged( MavenProject project ) { return project.hasLifecyclePhase( " package " ) || project.hasLifecyclePhase( "install" ) || project.hasLifecyclePhase( "deploy" ) || project artifact can be resolved from a remote repository. }

          People

          • Assignee:
            Unassigned
            Reporter:
            Christian Schulte
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: