quarkusio/quarkus · error · IllegalArgumentException

${archiveRoot} does not point to the application output dire

Error message

${archiveRoot} does not point to the application output directory

What it means

ArchiveRootBuildItem represents the directory that is the application's archive root (its compiled classes output). The constructor validates that the given path exists and is a directory; passing a missing or non-directory path throws IllegalArgumentException.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/builditem/ArchiveRootBuildItem.java:110

    }

    private final Path archiveRoot;
    private final Collection<Path> excludedFromIndexing;
    private final PathCollection rootDirs;
    private final PathCollection paths;

    /**
     * Constructs an {@link ArchiveRootBuildItem} with a single application classes directory.
     *
     * @param appClassesDir the path to the application classes directory
     */
    public ArchiveRootBuildItem(Path appClassesDir) {
        this(appClassesDir, appClassesDir, Collections.emptySet());
    }

    private ArchiveRootBuildItem(Path archiveLocation, Path archiveRoot, Collection<Path> excludedFromIndexing) {
        if (!Files.isDirectory(archiveRoot)) {
            throw new IllegalArgumentException(archiveRoot + " does not point to the application output directory");
        }
        this.rootDirs = PathList.of(archiveRoot);
        this.paths = PathList.of(archiveLocation);
        this.archiveRoot = archiveRoot;
        this.excludedFromIndexing = excludedFromIndexing;
    }

    private ArchiveRootBuildItem(Builder builder, QuarkusBuildCloseablesBuildItem buildCloseables) throws IOException {
        this.excludedFromIndexing = builder.excludedFromIndexing;
        if (!builder.archiveRoots.isEmpty()) {
            final PathList.Builder rootDirs = PathList.builder();
            final PathList.Builder paths = PathList.builder();
            for (Path root : builder.archiveRoots) {
                paths.add(root);
                if (Files.isDirectory(root)) {
                    rootDirs.add(root);
                } else {
                    final FileSystem fs = buildCloseables.add(ZipUtils.newFileSystem(root));

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the application classes directory exists (run compile before augmentation) and pass that path (e.g. target/classes).
  2. Verify the build tool's output directory configuration (maven-compiler-plugin outputDirectory / Gradle sourceSets.main.output).
  3. Check the path for typos and that it is not a JAR/file; use Files.isDirectory(path) as a precondition in custom tooling.

Example fix

// before
new ArchiveRootBuildItem(Path.of("target/myapp.jar"));
// after
Path classes = Path.of("target/classes");
if (Files.isDirectory(classes)) {
    new ArchiveRootBuildItem(classes);
}
Defensive patterns

Strategy: validation

Validate before calling

Path classes = Path.of("target/classes");
if (!Files.isDirectory(classes)) {
    throw new IllegalStateException("Compile the application first; missing " + classes);
}

Type guard

static boolean isValidArchiveRoot(Path p) {
    return p != null && Files.isDirectory(p);
}

Prevention

When it happens

Trigger: Constructing ArchiveRootBuildItem (directly or via the single-Path convenience constructor) with a Path that does not exist, is a file, or points at a JAR rather than an exploded classes directory.

Common situations: Running augmentation before compilation (target/classes missing); misconfigured maven/gradle output directory; passing a packaged JAR path where an exploded dir is required; custom tooling building the augmentor manually.

Related errors


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