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
- Ensure the application classes directory exists (run compile before augmentation) and pass that path (e.g. target/classes).
- Verify the build tool's output directory configuration (maven-compiler-plugin outputDirectory / Gradle sourceSets.main.output).
- 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
- Always compile before invoking augmentation in custom tooling.
- Verify the classes output directory in the build configuration.
- Never pass a JAR/file path where an exploded directory is expected.
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
- Failed to create output directory for generated sources: %s
- Unable to parse: ${resolvedModelPath}
- Unable to scan config group: ${configGroup}
- Unable to scan config root: ${configRoot}
- Unable to scan config mapping without config root: ${configM
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/e4e203f8264ad4bd.
Report an issue: GitHub.