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

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

commit fb549cffaad4d8a41b23b27f45c65a4658c76e11
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Thu Nov 5 01:08:03 2026 +0000

    Cover the three-token copy form and relax the resolve-sources missing check
---
 src/it/projects/copy-maven-coordinates/pom.xml       | 11 +++++++++++
 src/it/projects/copy-maven-coordinates/verify.groovy |  1 +
 src/it/projects/resolve-sources/verify.groovy        |  5 +++--
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/it/projects/copy-maven-coordinates/pom.xml 
b/src/it/projects/copy-maven-coordinates/pom.xml
index 4f9eb81a..56588acd 100644
--- a/src/it/projects/copy-maven-coordinates/pom.xml
+++ b/src/it/projects/copy-maven-coordinates/pom.xml
@@ -53,6 +53,17 @@
               <outputDirectory>target/legacy</outputDirectory>
             </configuration>
           </execution>
+          <execution>
+            <id>version-only</id>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              
<artifact>org.apache.maven.its.dependency:ResourceArtifact:1.0</artifact>
+              <outputDirectory>target/version-only</outputDirectory>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/src/it/projects/copy-maven-coordinates/verify.groovy 
b/src/it/projects/copy-maven-coordinates/verify.groovy
index bc4a960e..3766606f 100644
--- a/src/it/projects/copy-maven-coordinates/verify.groovy
+++ b/src/it/projects/copy-maven-coordinates/verify.groovy
@@ -22,6 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat
 def names = { String dir -> new File(basedir, dir).list().toList() }
 
 
assertThat(names("target/type-version")).containsExactly("ResourceArtifact-1.0.jar")
+assertThat(names("target/version-only")).containsExactly("ResourceArtifact-1.0.jar")
 
assertThat(names("target/type-classifier-version-scope")).containsExactly("ResourceArtifact-1.0-tests.jar")
 
assertThat(names("target/legacy")).containsExactly("ResourceArtifact-1.0-client.jar")
 
diff --git a/src/it/projects/resolve-sources/verify.groovy 
b/src/it/projects/resolve-sources/verify.groovy
index 9448e602..4a5e9296 100644
--- a/src/it/projects/resolve-sources/verify.groovy
+++ b/src/it/projects/resolve-sources/verify.groovy
@@ -24,7 +24,8 @@ def missing = notResolved < 0 ? [] : 
lines.subList(notResolved, lines.size())
 assert lines[0] == "The following files have been resolved:" : "Unexpected 
header in " + lines
 assert resolved.any { 
it.startsWith("org.apache.maven:maven-project:jar:sources:2.0.8") } : "Expected 
the sources of the dependency in " + lines
 assert resolved.any { 
it.startsWith("org.apache.maven:maven-model:jar:sources:2.0.8") } : "Expected 
the sources of a transitive dependency in " + lines
-// some old dependencies have no sources (which ones differs between Maven 3 
and 4); they are listed instead of failing the build
+// some old dependencies have no sources on Central (which ones differs 
between Maven 3 and 4 and over time); they are
+// listed instead of failing the build, so only check that whatever is listed 
is a sources jar
 def missingSources = missing.drop(1).findAll { it }
-assert !missingSources.isEmpty() : "Expected the missing sources to be listed 
in " + lines
 assert missingSources.every { it.contains(":jar:sources:") } : "Expected only 
sources jars among the missing in " + lines
+assert resolved.every { it.contains(":jar:sources:") || it.startsWith("The 
following") || !it } : "Expected only sources jars among the resolved in " + 
lines

Reply via email to