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 2023/12/10 16:17:49 UTC
(maven-dependency-plugin) branch doxia-2.0.0 updated (20ea986b -> 6d70645d)
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 20ea986b Prepare for Doxia 2.0.0
new 6d70645d Prepare for Doxia 2.0.0
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 (20ea986b)
\
N -- N -- N refs/heads/doxia-2.0.0 (6d70645d)
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 | 4 +-
.../apache/maven/plugins/dependency/TestSkip.java | 48 ++++++++++++++++++++--
2 files changed, 46 insertions(+), 6 deletions(-)
(maven-dependency-plugin) 01/01: Prepare for Doxia 2.0.0
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 6d70645d7f1381db431df51ce03dd4c0bac7df7d
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 3 02:13:19 2022 +0100
Prepare for Doxia 2.0.0
---
pom.xml | 24 ++++-------
.../verify.bsh | 4 +-
.../{AnalyzeReportMojo.java => AnalyzeReport.java} | 4 +-
.../apache/maven/plugins/dependency/TestSkip.java | 48 ++++++++++++++++++++--
4 files changed, 54 insertions(+), 26 deletions(-)
diff --git a/pom.xml b/pom.xml
index dea87485..0c133f6d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@ under the License.
</parent>
<artifactId>maven-dependency-plugin</artifactId>
- <version>3.6.2-SNAPSHOT</version>
+ <version>3.7.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Maven Dependency Plugin</name>
@@ -165,33 +165,23 @@ under the License.
<scope>provided</scope>
</dependency>
- <!-- reporting -->
+ <!-- doxia -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
- <version>1.11.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- </exclusions>
+ <version>2.0.0-M8</version>
</dependency>
+
+ <!-- reporting -->
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>3.1.1</version>
+ <version>4.0.0-M9</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>
- </exclusions>
+ <version>4.0.0-M12</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
diff --git a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
index ba623ba7..c5c7993f 100644
--- a/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
+++ b/src/it/projects/analyze-testDependencyWithNonTestScope/verify.bsh
@@ -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 5ef0ea7c..856d7fae 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
@@ -41,7 +41,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 -----------------------------------------------------------------
/**
@@ -115,13 +115,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 1b192308..051b73d2 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
@@ -20,7 +20,11 @@ package org.apache.maven.plugins.dependency;
import java.io.File;
+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.mockito.ArgumentCaptor;
@@ -42,7 +46,7 @@ public class TestSkip extends AbstractDependencyMojoTestCase {
}
public void testSkipAnalyzeReport() throws Exception {
- doSpecialTest("analyze-report");
+ doSpecialTest("analyze-report", true);
}
public void testSkipAnalyzeDuplicate() throws Exception {
@@ -110,19 +114,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;
}
}