Skip to content

k-wall/copy-deps-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Standalone reproducer for a suspect Maven maven-dependency-plugin issue.

Background - I'm testing a project with a new version of a dependency (org.apache.kafka:kafka-clients:pom:4.2.0) that is available from the Apache staging repo. It is not available on Maven Central.

EDIT: I suspect this is apache/maven-dependency-plugin#1028

The project uses copy-dependencies to get the project's dependencies in a pre-integration test phase.
copy-dependencies is failing in an unexpected way whilst trying to download the dependency's POM.

mvn -X -Dmaven.repo.local=/tmp/rep${RANDOM} clean verify 
[INFO] Artifact org.apache.kafka:kafka-clients:pom:4.2.0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases)]
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/kafka/kafka-clients/4.2.0/kafka-clients-4.2.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.347 s
[INFO] Finished at: 2026-02-03T18:10:26Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.9.0:copy-dependencies (copy-deps) on project test: Coud not build project for org.apache.kafka:kafka-clients:jar:4.2.0: Error resolving project artifact: The following artifacts could not be resolved: org.apache.kafka:kafka-clients:pom:4.2.0 (present, but unavailable): Could not find artifact org.apache.kafka:kafka-clients:pom:4.2.0 in central (https://repo.maven.apache.org/maven2) for project org.apache.kafka:kafka-clients:jar:4.2.0 -> [Help 1]

I notice that if I disable addParentPoms in copy-dependency's configuration, the issue goes away.

mvn -Dmaven.repo.local=/tmp/rep${RANDOM} clean verify -DaddParentPoms=false
...
[INFO] BUILD SUCCESS
find target/local-repo/org/apache/kafka/kafka-clients 
target/local-repo/org/apache/kafka/kafka-clients
target/local-repo/org/apache/kafka/kafka-clients/maven-metadata-local.xml
target/local-repo/org/apache/kafka/kafka-clients/4.2.0
target/local-repo/org/apache/kafka/kafka-clients/4.2.0/kafka-clients-4.2.0.pom
target/local-repo/org/apache/kafka/kafka-clients/4.2.0/kafka-clients-4.2.0.jar
target/local-repo/org/apache/kafka/kafka-clients/4.2.0/_remote.repositories

The project itself relies on addParentPoms to fetch the parents of other dependencies

About

Reproducer for a suspect maven-dependencies plugin issue

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors