You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/09/20 20:34:32 UTC

[maven-dependency-plugin] branch MDEP-827 updated (761c7aa2 -> 6cfaa642)

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

michaelo pushed a change to branch MDEP-827
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git


 discard 761c7aa2 [MDEP-827] Use outputDirectory from AbstractMavenReport
     new 6cfaa642 [MDEP-827] Use outputDirectory from AbstractMavenReport

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (761c7aa2)
            \
             N -- N -- N   refs/heads/MDEP-827 (6cfaa642)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-dependency-plugin] 01/01: [MDEP-827] Use outputDirectory from AbstractMavenReport

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MDEP-827
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit 6cfaa642493a901a8dc8c2c23a0b702a3c53f00f
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri Sep 16 11:32:20 2022 +0200

    [MDEP-827] Use outputDirectory from AbstractMavenReport
    
    A reporting plugin shall generate reports always in the reporting output dir.
    Inherit from parent and don't set manually otherwise you end up in broken output
    like this:
    Only in it/analyze-testDependencyWithNonTestScope/target: css
    Only in it/analyze-testDependencyWithNonTestScope/target: dependency-analysis.html
    Only in it/analyze-testDependencyWithNonTestScope/target: images
    
    which is non-sense since this is clearly site content even if rendered in
    standalone mode. The output dir will be created by the caller/system.
    
    This closes #251
---
 .../verify.bsh                                     |  2 +-
 .../dependency/analyze/AnalyzeReportMojo.java      | 30 ++--------------------
 2 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
index 9ff1775b..ba623ba7 100644
--- a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
+++ b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
@@ -24,7 +24,7 @@ import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 
-File htmlFile = new File( basedir, "target/dependency-analysis.html" );
+File htmlFile = new File( basedir, "target/site/dependency-analysis.html" );
 
 if ( !htmlFile.isFile() )
 {
diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java
index b6f522f8..fd51491f 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java
@@ -32,7 +32,6 @@ import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis;
 import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer;
 import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerException;
 
-import java.io.File;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
@@ -55,17 +54,9 @@ public class AnalyzeReportMojo
     @Component
     private ProjectDependencyAnalyzer analyzer;
 
-    /**
-     * Target folder
-     *
-     * @since 2.0-alpha-5
-     */
-    @Parameter( defaultValue = "${project.build.directory}", readonly = true )
-    private File outputDirectory;
-
     /**
      * Ignore Runtime/Provided/Test/System scopes for unused dependency analysis
-     * 
+     *
      * @since 2.2
      */
     @Parameter( property = "ignoreNonCompile", defaultValue = "false" )
@@ -74,7 +65,7 @@ public class AnalyzeReportMojo
     /**
      * Force dependencies as used, to override incomplete result caused by bytecode-level analysis. Dependency format is
      * <code>groupId:artifactId</code>.
-     * 
+     *
      * @since 2.6
      */
     @Parameter
@@ -97,12 +88,6 @@ public class AnalyzeReportMojo
     public void executeReport( Locale locale )
         throws MavenReportException
     {
-        if ( outputDirectory == null || !outputDirectory.exists() )
-        {
-            getLog().info( "Skipping project with no Target directory" );
-            return;
-        }
-
         // Step 1: Analyze the project
         ProjectDependencyAnalysis analysis;
         try
@@ -183,17 +168,6 @@ public class AnalyzeReportMojo
         return getBundle( locale ).getString( "analyze.report.description" );
     }
 
-    /*
-     * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
-     */
-    @Override
-    protected String getOutputDirectory()
-    {
-        getLog().info( outputDirectory.toString() );
-
-        return outputDirectory.toString();
-    }
-
     // protected methods ------------------------------------------------------
 
     /**