quarkusio/quarkus · error · IllegalArgumentException

Application artifact is null

Error message

Application artifact is null

What it means

doResolveModel requires the coordinates of the application artifact to resolve its dependency graph. A null coords argument is a caller programming error, thrown as an IllegalArgumentException before any Maven resolution is attempted.

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java:317

                version = constraint.getArtifact().getVersion();
            }
            directDeps.add(new Dependency(
                    new DefaultArtifact(d.getGroupId(), d.getArtifactId(), d.getClassifier(), null, version,
                            mvn.getSession().getArtifactTypeRegistry().get(d.getType())),
                    d.getScope(), d.isOptional(), toAetherExclusions(d.getExclusions())));
        }

        return buildAppModel(mainDep, mainArtifact, directDeps, mvn.getRepositories(), Set.of(), managedDeps);
    }

    private ApplicationModel doResolveModel(ArtifactCoords coords,
            List<Dependency> directMvnDeps,
            Set<ArtifactKey> excludedArtifacts,
            ArtifactCoords managingProject,
            Set<ArtifactKey> reloadableModules)
            throws AppModelResolverException {
        if (coords == null) {
            throw new IllegalArgumentException("Application artifact is null");
        }
        Artifact mvnArtifact = toAetherArtifact(coords);

        Map<ArtifactKey, Dependency> managedDeps = null;
        List<RemoteRepository> managedRepos = List.of();
        if (managingProject != null) {
            final ArtifactDescriptorResult managingDescr = mvn.resolveDescriptor(toAetherArtifact(managingProject));
            managedDeps = DependencyUtils.toMap(managingDescr.getManagedDependencies());
            managedRepos = mvn.newResolutionRepositories(managingDescr.getRepositories());
        }

        List<RemoteRepository> aggregatedRepos = mvn.aggregateRepositories(managedRepos, mvn.getRepositories());
        final ResolvedDependencyBuilder appArtifact = resolve(coords, mvnArtifact, aggregatedRepos).setRuntimeCp();
        mvnArtifact = toAetherArtifact(appArtifact);
        final ArtifactDescriptorResult appArtifactDescr = resolveDescriptor(mvnArtifact, aggregatedRepos);

        if (managedDeps != null && !managedDeps.isEmpty()) {
            DependencyUtils.putAll(managedDeps, appArtifactDescr.getManagedDependencies());

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the caller supplies valid ArtifactCoords (groupId, artifactId, version) for the application before invoking resolveManagedModel/resolveModel APIs.
  2. Check upstream parsing of the app artifact string; a null usually means the coordinate string was missing or failed to parse.
  3. Add a guard/assertion in the calling code to fail early with a clear message.

Example fix

// before
resolver.resolveManagedModel(null, directDeps, ...);
// after
if (appCoords == null) { throw new IllegalArgumentException("app artifact coords must be set"); }
resolver.resolveManagedModel(appCoords, directDeps, ...);
Defensive patterns

Strategy: type-guard

Validate before calling

Objects.requireNonNull(appCoords, "Application artifact coordinates must not be null");
resolver.resolveManagedModel(appCoords, directDeps, excluded, managingProject, reloadable);

Type guard

static boolean isValidCoords(io.quarkus.maven.dependency.ArtifactCoords c) {
    return c != null && c.getGroupId() != null && !c.getGroupId().isBlank()
        && c.getArtifactId() != null && !c.getArtifactId().isBlank()
        && c.getVersion() != null && !c.getVersion().isBlank();
}

Try / catch

try {
    model = resolver.resolveManagedModel(coords, ...);
} catch (IllegalArgumentException e) {
    if ("Application artifact is null".equals(e.getMessage())) {
        throw new IllegalStateException("App artifact coords were not configured; check quarkus.application.* config", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Any path into doResolveModel (e.g. via resolveManagedModel) where the ArtifactCoords parameter is null — typically an API caller passing an unset/failed-to-parse application artifact.

Common situations: Tooling code that derives app coordinates from configuration (quarkus.application.* or CLI args) and passes them on without a null check when the config value is absent.

Related errors


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