Skip to content
Latchkey

Maven "The following artifacts could not be resolved" - Fix in CI

Maven aggregated every artifact it failed to fetch into one list. The detail after the colon names each missing groupId:artifactId:version - they were never published, live on an undeclared repo, or are sibling modules not yet built.

What this error means

Resolution ends with Could not resolve dependencies for project ...: The following artifacts could not be resolved: <a>, <b>, ... plus a reason like "not found" or "transfer failed" for each.

mvn output
[ERROR] Failed to execute goal on project app: Could not resolve dependencies
for project com.example:app:jar:1.0.0: The following artifacts could not be
resolved: com.example:core:jar:1.0.0 (absent), com.example:util:jar:1.0.0 (absent):
Could not find artifact com.example:core:jar:1.0.0 in central

Common causes

Sibling modules not built into the local repo

In a multi-module build, depending on com.example:core requires core to be in the reactor or already installed. Building one module alone leaves the siblings unresolved.

Artifacts missing or on an undeclared repo

Each listed artifact was never published, or lives on a private repo Maven is not configured for, so every one in the list fails to resolve.

How to fix it

Build sibling modules together with -am

Build the target module plus the upstream modules it needs in one reactor.

Terminal
mvn -B -pl :app -am install
# -am ("also make") builds com.example:core and :util first

Declare the repo or force a re-resolve

  1. For external artifacts, declare the hosting repository so each resolves.
  2. Run mvn -U to clear cached negatives after publishing the missing artifacts.
  3. Use mvn dependency:tree to confirm which configuration pulls each missing item.

How to prevent it

  • Build multi-module projects from the aggregator with -am when targeting one module.
  • Install or deploy shared modules before building dependents in isolation.
  • Declare every repository hosting the listed artifacts.

Frequently asked questions

What causes ""The following artifacts could not be resolved""?
In a multi-module build, depending on com.example:core requires core to be in the reactor or already installed. Building one module alone leaves the siblings unresolved.
How do I fix "The following artifacts could not be resolved"?
Build the target module plus the upstream modules it needs in one reactor.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card