quarkusio/quarkus · error · RuntimeException

Failed to resolve artifact: ${gav}

Error message

Failed to resolve artifact: ${gav}

What it means

fetchRecipes() resolves the update recipe artifact (GAV) from a Maven repository before extracting recipe YAML. If artifact resolution fails with BootstrapMavenException, the error is wrapped in RuntimeException("Failed to resolve artifact: <gav>"). This means the artifact could not be downloaded — not that its contents are bad.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdatesRepository.java:119

                    throw new RuntimeException(
                            "quarkus update artifacts require multiple rewrite plugin versions: " + propRewritePluginVersion
                                    + " and " + pluginVersion);
                }
                if (log.isDebugEnabled()) {
                    log.debug(String.format(
                            "=> %d specific recipe" + (recipes.size() != 1 ? "s" : "")
                                    + " found (compatible with OpenRewrite %s plugin version: %s)",
                            recipes.size(),
                            buildTool,
                            propRewritePluginVersion));
                } else {
                    log.info(String.format(
                            "=> %s specific recipe" + (recipes.size() != 1 ? "s" : "") + " found",
                            MessageFormatter.green(String.valueOf(recipes.size()))));
                }

            } catch (BootstrapMavenException e) {
                throw new RuntimeException("Failed to resolve artifact: " + gav, e);
            } catch (IOException e) {
                throw new RuntimeException("Failed to load recipes in artifact: " + gav, e);
            }
        }

        return new FetchResult(String.join(",", artifacts),
                recipes, propRewritePluginVersion);
    }

    private static String getPropRewritePluginVersion(Properties props, BuildTool buildTool) {
        switch (buildTool) {
            case MAVEN:
                return Optional.ofNullable(props.getProperty(PROP_REWRITE_MAVEN_PLUGIN_VERSION))
                        .orElse(DEFAULT_MAVEN_REWRITE_PLUGIN_VERSION);
            case GRADLE:
            case GRADLE_KOTLIN_DSL:
                return Optional.ofNullable(props.getProperty(PROP_REWRITE_GRADLE_PLUGIN_VERSION))
                        .orElse(DEFAULT_GRADLE_REWRITE_PLUGIN_VERSION);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the GAV coordinates and that the artifact exists in the target repository (e.g. search Maven Central).
  2. Check network access / proxy settings and ~/.m2/settings.xml repository definitions and credentials.
  3. Retry after the artifact is deployed, or build/install it locally with `mvn install`.
  4. Clear stale cached failure metadata in ~/.m2/repository for that artifact and retry.

Example fix

// before: nonexistent artifact
--artifact=io.quarkus:quarkus-update-recipes:9.9
// after: valid published artifact
--artifact=io.quarkus:quarkus-update-recipes:3.15.0
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check resolution with Maven before running the update:
// mvn dependency:get -Dartifact=io.quarkus:quarkus-update-recipes:3.15.0

Try / catch

try {
    FetchResult r = repo.fetchRecipes(gav, buildTool, ...);
} catch (RuntimeException e) {
    if (e.getCause() instanceof BootstrapMavenException) {
        log.error("Cannot resolve " + gav + ": check coordinates, network, and ~/.m2/settings.xml", e);
    }
}

Prevention

When it happens

Trigger: Calling fetchRecipes (via pluginVersion/newRecipes flow of `quarkus update`) with a GAV that does not exist in the configured repositories, cannot be reached over the network, or requires credentials the local Maven settings do not provide.

Common situations: Typo in groupId:artifactId:version of the update artifact; offline/VPN/air-gapped environment with no access to Maven Central or the internal repo; corporate Nexus/Artifactory requires authentication; artifact not yet deployed to the internal repository.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/20b57f96ed1d19d5. Report an issue: GitHub.