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 2024/06/02 19:36:53 UTC

(maven-dependency-plugin) branch doxia-2.0.0 updated (9e463986 -> f1c6c505)

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

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


    omit 9e463986 [MDEP-903] Upgrade to Doxia 2.0.0 Milestone Stack
     add 43110117 [MDEP-923] Exclude only specific artifacts from dependencies
     add e87a5bd6 [MDEP-919] Set m.r.dependencyManagerTransitivity for tree ITs - Maven 4 compatibility
     add 1ee4a22d Bump org.apache.maven.shared:maven-dependency-analyzer (#392)
     add cf2f3a9e [MDEP-928] Allow to exclude classes from dependency:analyze
     add 27d2eb9e [MDEP-929] Bump org.apache.maven.shared:maven-dependency-analyzer (#394)
     add 09775b3c [MDEP-799] tree: add optional output type json (#391)
     add c0e89499 [MDEP-923] Extract copyFile method from AbstractDependencyMojo (#389)
     add f29c80b2 [MDEP-710] re-enable test in TestTreeMojo
     add 1c4b24d3 [MDEP-920] Bump org.assertj:assertj-core from 3.25.3 to 3.26.0 (#395)
     add bd94ad90 [MDEP-799] Add simple info json format for tree and cleanups
     add 3da6db70 [MDEP-935] Improvement ITs for dependency:tree
     add f82a019b Add missing dependency
     add 31fa4f72 [MDEP-936] Bump org.apache.maven.shared:maven-dependency-tree from 3.2.1 to 3.3.0 (#397)
     add 07dbccc8 Remove useless exclude
     new f1c6c505 [MDEP-903] Upgrade to Doxia 2.0.0 Milestone Stack

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   (9e463986)
            \
             N -- N -- N   refs/heads/doxia-2.0.0 (f1c6c505)

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:
 pom.xml                                            |  84 ++++-----
 .../invoker.properties                             |   0
 .../{analyze => analyze-excluded-classes}/pom.xml  |  22 +--
 .../setup.groovy}                                  |  10 +-
 .../src/main/java/Main.java                        |   0
 .../verify.groovy                                  |  15 +-
 .../projects/{tree => tree-excluded}/expected.txt  |   1 -
 .../invoker.properties                             |   0
 src/it/projects/{collect => tree-excluded}/pom.xml |   4 +-
 .../test.properties                                |   2 +-
 .../verify.groovy                                  |   7 +-
 src/it/projects/tree-includes/verify.bsh           |  37 ----
 .../verify.groovy                                  |   7 +-
 src/it/projects/tree-multimodule/test.properties   |   1 +
 src/it/projects/tree-multimodule/verify.bsh        |  63 -------
 .../setup.bsh => tree-multimodule/verify.groovy}   |  24 +--
 src/it/projects/tree-scope/expected1.txt           |  37 ++++
 src/it/projects/tree-scope/expected2.txt           |  39 ++++
 .../invoker.properties                             |   8 +-
 .../{list-repositories => tree-scope}/pom.xml      |  21 ++-
 .../test1.properties}                              |   4 +-
 .../test2.properties}                              |   4 +-
 .../HelloTest.java => tree-scope/verify.groovy}    |  17 +-
 .../tree-verbose-multimodule/test.properties       |   1 +
 .../projects/tree-verbose-multimodule/verify.bsh   |  57 ------
 .../verify.groovy}                                 |  24 +--
 src/it/projects/tree-verbose-small/verify.bsh      |  35 ----
 .../verify.groovy                                  |   9 +-
 .../{go-offline => tree-verbose}/test.properties   |   2 +-
 src/it/projects/tree-verbose/verify.bsh            |  36 ----
 .../verify.groovy                                  |   7 +-
 .../plugins/dependency/AbstractDependencyMojo.java |  37 ----
 .../dependency/analyze/AbstractAnalyzeMojo.java    |  10 +-
 .../plugins/dependency/analyze/AnalyzeReport.java  |  11 +-
 .../dependency/fromConfiguration/CopyMojo.java     |  14 +-
 .../fromDependencies/CopyDependenciesMojo.java     |  20 +-
 .../resolvers/ResolveDependenciesMojo.java         |   8 +
 .../dependency/resolvers/ResolvePluginsMojo.java   |   8 +
 .../dependency/tree/JsonDependencyNodeVisitor.java | 204 +++++++++++++++++++++
 .../maven/plugins/dependency/tree/TreeMojo.java    |  57 ++----
 .../maven/plugins/dependency/utils/CopyUtil.java   |  73 ++++++++
 .../dependency/AbstractDependencyMojoTestCase.java |   6 +-
 .../fromDependencies/TestCopyDependenciesMojo.java |   4 +-
 .../plugins/dependency/tree/TestTreeMojo.java      |  86 ++++++++-
 44 files changed, 640 insertions(+), 476 deletions(-)
 copy src/it/projects/{mdep-752-analyze-ignored-packaging-custom => analyze-excluded-classes}/invoker.properties (100%)
 copy src/it/projects/{analyze => analyze-excluded-classes}/pom.xml (82%)
 copy src/it/projects/{mdep-450-project-with-ancestor/verify.groovy => analyze-excluded-classes/setup.groovy} (80%)
 copy src/it/projects/{analyze-invalid-exclude => analyze-excluded-classes}/src/main/java/Main.java (100%)
 copy src/it/projects/{mdep-752-analyze-ignored-packaging-custom => analyze-excluded-classes}/verify.groovy (65%)
 copy src/it/projects/{tree => tree-excluded}/expected.txt (93%)
 copy src/it/projects/{tree-includes => tree-excluded}/invoker.properties (100%)
 copy src/it/projects/{collect => tree-excluded}/pom.xml (95%)
 copy src/it/projects/{tree-includes => tree-excluded}/test.properties (96%)
 copy src/it/projects/{mdep-450-project-with-ancestor => tree-excluded}/verify.groovy (82%)
 delete mode 100644 src/it/projects/tree-includes/verify.bsh
 copy src/it/projects/{mdep-450-project-with-ancestor => tree-includes}/verify.groovy (82%)
 delete mode 100644 src/it/projects/tree-multimodule/verify.bsh
 copy src/it/projects/{copy-from-remote-repository/setup.bsh => tree-multimodule/verify.groovy} (65%)
 create mode 100644 src/it/projects/tree-scope/expected1.txt
 create mode 100644 src/it/projects/tree-scope/expected2.txt
 copy src/it/projects/{mdep-204-go-offline-resolve-intermodule => tree-scope}/invoker.properties (80%)
 copy src/it/projects/{list-repositories => tree-scope}/pom.xml (86%)
 copy src/it/projects/{analyze-dep-mgt/invoker.properties => tree-scope/test1.properties} (88%)
 copy src/it/projects/{analyze-dep-mgt/invoker.properties => tree-scope/test2.properties} (89%)
 copy src/it/projects/{analyze-testDependencyWithNonTestScope/src/test/java/hello/HelloTest.java => tree-scope/verify.groovy} (72%)
 delete mode 100644 src/it/projects/tree-verbose-multimodule/verify.bsh
 copy src/it/projects/{copy-from-remote-repository/setup.bsh => tree-verbose-multimodule/verify.groovy} (65%)
 delete mode 100644 src/it/projects/tree-verbose-small/verify.bsh
 copy src/it/projects/{mdep-450-project-with-ancestor => tree-verbose-small}/verify.groovy (81%)
 copy src/it/projects/{go-offline => tree-verbose}/test.properties (93%)
 delete mode 100644 src/it/projects/tree-verbose/verify.bsh
 copy src/it/projects/{mdep-450-project-with-ancestor => tree-verbose}/verify.groovy (82%)
 create mode 100644 src/main/java/org/apache/maven/plugins/dependency/tree/JsonDependencyNodeVisitor.java
 create mode 100644 src/main/java/org/apache/maven/plugins/dependency/utils/CopyUtil.java


(maven-dependency-plugin) 01/01: [MDEP-903] Upgrade to Doxia 2.0.0 Milestone Stack

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

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

commit f1c6c5050e2590903207b42eb50b1705627e44db
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 3 02:13:19 2022 +0100

    [MDEP-903] Upgrade to Doxia 2.0.0 Milestone Stack
    
    This closes #314
---
 pom.xml                                            | 57 ++++------------------
 src/it/projects/analyze-report/verify.bsh          |  6 +--
 .../verify.bsh                                     | 10 ++--
 .../{AnalyzeReportMojo.java => AnalyzeReport.java} |  4 +-
 .../apache/maven/plugins/dependency/TestSkip.java  | 48 ++++++++++++++++--
 5 files changed, 62 insertions(+), 63 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6208fa00..74851d88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,30 +87,17 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <mavenVersion>3.6.3</mavenVersion>
     <javaVersion>8</javaVersion>
-
+    <mavenVersion>3.6.3</mavenVersion>
+    <resolverVersion>1.4.1</resolverVersion>
+    <slf4jVersion>1.7.36</slf4jVersion>
     <jettyVersion>9.4.54.v20240208</jettyVersion>
     <mockito.version>4.11.0</mockito.version>
     <plexus-archiver.version>4.9.2</plexus-archiver.version>
     <pluginTestingVersion>3.3.0</pluginTestingVersion>
-    <resolverVersion>1.4.1</resolverVersion>
-    <slf4jVersion>1.7.36</slf4jVersion>
-
     <project.build.outputTimestamp>2023-10-20T21:21:50Z</project.build.outputTimestamp>
   </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <!-- override the version from maven-reporting-impl -->
-      <dependency>
-        <groupId>org.apache.commons</groupId>
-        <artifactId>commons-text</artifactId>
-        <version>1.12.0</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
     <!-- maven -->
     <dependency>
@@ -156,49 +143,23 @@ under the License.
       <scope>provided</scope>
     </dependency>
 
-    <!-- reporting -->
+    <!-- doxia -->
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-sink-api</artifactId>
-      <version>1.12.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.plexus</groupId>
-          <artifactId>plexus-container-default</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>2.0.0-M12</version>
     </dependency>
+
+    <!-- reporting -->
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-api</artifactId>
-      <version>3.1.1</version>
+      <version>4.0.0-M12</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>3.2.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.plexus</groupId>
-          <artifactId>plexus-container-default</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.maven</groupId>
-          <artifactId>maven-artifact</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.maven</groupId>
-          <artifactId>maven-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.maven</groupId>
-          <artifactId>maven-model</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.maven</groupId>
-          <artifactId>maven-plugin-api</artifactId>
-        </exclusion>
-      </exclusions>
+      <version>4.0.0-M15</version>
     </dependency>
     <dependency>
       <groupId>commons-io</groupId>
diff --git a/src/it/projects/analyze-report/verify.bsh b/src/it/projects/analyze-report/verify.bsh
index d32f9f90..55b19f0b 100644
--- a/src/it/projects/analyze-report/verify.bsh
+++ b/src/it/projects/analyze-report/verify.bsh
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,7 +19,7 @@
 
 import java.io.*;
 
-File htmlFile = new File( basedir, "target/site/dependency-analysis.html" );
+File htmlFile = new File( basedir, "target/reports/dependency-analysis.html" );
 
 if ( !htmlFile.isFile() )
 {
diff --git a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
index ba623ba7..46c27ff4 100644
--- a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
+++ b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -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/site/dependency-analysis.html" );
+File htmlFile = new File( basedir, "target/reports/dependency-analysis.html" );
 
 if ( !htmlFile.isFile() )
 {
@@ -37,7 +37,7 @@ if ( htmlFile.length() == 0 )
 
 Document doc = Jsoup.parse( htmlFile, "UTF-8");
 
-Elements entry = doc.select( "#contentBox > section > section:nth-child(5) > table > tbody > tr.b" );
+Elements entry = doc.select( "#bodyColumn > section > section:nth-child(5) > table > tbody > tr.b" );
 
 if( entry.isEmpty() )
 {
@@ -50,7 +50,7 @@ else if ( entry.size() != 1 )
 }
 
 Element groupIdElement = doc.select(
-"#contentBox > section > section:nth-child(5) > table > tbody > tr.b > td:nth-child(1)" ).first();
+"#bodyColumn > section > section:nth-child(5) > table > tbody > tr.b > td:nth-child(1)" ).first();
 
 String groupId = groupIdElement.text();
 
diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReport.java
similarity index 96%
rename from src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java
rename to src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReport.java
index 0c8d4ce6..239bc825 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReportMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReport.java
@@ -42,7 +42,7 @@ import org.codehaus.plexus.i18n.I18N;
  */
 @Mojo(name = "analyze-report", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
 @Execute(phase = LifecyclePhase.TEST_COMPILE)
-public class AnalyzeReportMojo extends AbstractMavenReport {
+public class AnalyzeReport extends AbstractMavenReport {
     // fields -----------------------------------------------------------------
 
     /**
@@ -124,13 +124,11 @@ public class AnalyzeReportMojo extends AbstractMavenReport {
     @Override
     public boolean canGenerateReport() {
         if (skip) {
-            getLog().info("Skipping plugin execution");
             return false;
         }
 
         // Step 0: Checking pom availability
         if ("pom".equals(project.getPackaging())) {
-            getLog().info("Skipping pom project");
             return false;
         }
 
diff --git a/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java b/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
index b52a9e81..1fbcacb0 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
@@ -21,7 +21,11 @@ package org.apache.maven.plugins.dependency;
 import java.io.File;
 
 import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.Mojo;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.dependency.testUtils.stubs.DependencyProjectStub;
 import org.apache.maven.project.MavenProject;
@@ -56,7 +60,7 @@ public class TestSkip extends AbstractDependencyMojoTestCase {
     }
 
     public void testSkipAnalyzeReport() throws Exception {
-        doSpecialTest("analyze-report");
+        doSpecialTest("analyze-report", true);
     }
 
     public void testSkipAnalyzeDuplicate() throws Exception {
@@ -124,19 +128,55 @@ public class TestSkip extends AbstractDependencyMojoTestCase {
     }
 
     protected void doSpecialTest(String mojoName) throws Exception {
-        doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml");
+        doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml", false);
+    }
+
+    protected void doSpecialTest(String mojoName, boolean addMojoExecution) throws Exception {
+        doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml", addMojoExecution);
     }
 
     private void doConfigTest(String mojoName, String configFile) throws Exception {
+        doConfigTest(mojoName, configFile, false);
+    }
+
+    private void doConfigTest(String mojoName, String configFile, boolean addMojoExecution) throws Exception {
         File testPom = new File(getBasedir(), "target/test-classes/unit/skip-test/" + configFile);
         Mojo mojo = lookupMojo(mojoName, testPom);
-        assertNotNull(mojo);
+        assertNotNull("Mojo not found.", mojo);
+
+        if (addMojoExecution) {
+            setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution(mojoName));
+        }
         Log log = mock(Log.class);
         mojo.setLog(log);
         mojo.execute();
 
         ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
         verify(log, atLeastOnce()).info(captor.capture());
-        assertTrue(captor.getValue().contains("Skipping plugin execution"));
+        String skipMessage;
+        if (addMojoExecution) {
+            MojoExecution me = getMockMojoExecution(mojoName);
+            String reportMojoInfo = me.getPlugin().getId() + ":" + me.getGoal();
+            skipMessage = "Skipping " + reportMojoInfo + " report goal";
+        } else {
+            skipMessage = "Skipping plugin execution";
+        }
+        assertTrue(captor.getValue().contains(skipMessage));
+    }
+
+    private MojoExecution getMockMojoExecution(String goal) {
+        MojoDescriptor md = new MojoDescriptor();
+        md.setGoal(goal);
+
+        MojoExecution me = new MojoExecution(md);
+
+        PluginDescriptor pd = new PluginDescriptor();
+        Plugin p = new Plugin();
+        p.setGroupId("org.apache.maven.plugins");
+        p.setArtifactId("maven-dependency-plugin");
+        pd.setPlugin(p);
+        md.setPluginDescriptor(pd);
+
+        return me;
     }
 }