quarkusio/quarkus · error · RuntimeException

Additional application archives can only be provided from th

Error message

Additional application archives can only be provided from the user providers directory. ${path} is not present in ${userProviders}

What it means

AbstractFastJarBuilder.build throws this RuntimeException when an additional application archive is not located directly inside the user providers directory. In the fast-jar layout, additional archives must come from the user providers directory so they can be placed on the lib directory classpath correctly; any archive elsewhere is rejected.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/pkg/jar/AbstractFastJarBuilder.java:271

                        executorService, treeShakeResult, newFilePermissions);
            } else if (includeAppDependency(appDep, outputTarget.getIncludedOptionalDependencies(), removedArtifactKeys)) {
                appDep.getResolvedPaths().forEach(fastJarJarsBuilder::addDependency);
            }
            if (parentFirstArtifactKeys.contains(appDep.getKey())) {
                appDep.getResolvedPaths().forEach(parentFirst::add);
                bootArtifacts.add(appDep);
                if ("quarkus-bootstrap-runner".equals(appDep.getArtifactId())) {
                    List<Path> paths = copiedArtifacts.get(appDep.getKey());
                    if (paths != null && !paths.isEmpty()) {
                        bootstrapRunnerPath = paths.get(0);
                    }
                }
            }
        }
        for (AdditionalApplicationArchiveBuildItem i : additionalApplicationArchives) {
            for (Path path : i.getResolvedPaths()) {
                if (!path.getParent().equals(userProviders)) {
                    throw new RuntimeException(
                            "Additional application archives can only be provided from the user providers directory. " + path
                                    + " is not present in " + userProviders);
                }
                fastJarJarsBuilder.addDependency(path);
            }
        }

        Path appInfo = buildDir.resolve(QuarkusEntryPoint.QUARKUS_APPLICATION_DAT);
        FastJarJars fastJarJars = fastJarJarsBuilder.build();
        try (OutputStream out = Files.newOutputStream(appInfo)) {
            List<Path> allJars = new ArrayList<>();
            if (fastJarJars.transformedJar != null) {
                allJars.add(fastJarJars.transformedJar);
            }
            allJars.add(fastJarJars.generatedJar);
            allJars.add(fastJarJars.runnerJar);
            List<Path> sortedDeps = new ArrayList<>(fastJarJars.dependencies);
            Collections.sort(sortedDeps);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Move the additional archive(s) into the user providers directory so their parent equals userProviders.
  2. Configure quarkus.user-providers (or the providers directory option) to point at the directory holding your extra jars.
  3. Remove the additionalApplicationArchiveBuildItem if the jar is already on the classpath via Maven/Gradle dependencies.

Example fix

// before
cp mylib.jar target/quarkus-app/lib/main/
// after
cp mylib.jar providers/
./mvnw package -Dquarkus.package.user-providers=providers
Defensive patterns

Strategy: validation

Validate before calling

Path userProviders = Path.of("providers").toAbsolutePath();
for (Path jar : additionalJars) {
    if (!jar.getParent().equals(userProviders)) {
        throw new IllegalStateException("Additional archive must be in " + userProviders + ": " + jar);
    }
}

Prevention

When it happens

Trigger: Building a fast-jar (or uber-jar over fast jar) while additionalApplicationArchives contains a resolved path whose parent directory is not the configured userProviders directory (quarkus.bootstrap.user-providers-directory / quarkus.args-style provider dir).

Common situations: Adding extra jars to the application via build items or configuration without placing them in the user providers directory; pointing an additional archive at a jar in target/dependency or an arbitrary path.

Related errors


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