quarkusio/quarkus · error · MessageBundleException

Duplicate localized files with priority {priority} found: -

Error message

Duplicate localized files with priority {priority} found:
	- {locale}: {files}

What it means

When resolving localized message bundle files (e.g. messages_en.properties), Qute assigns priorities to files found in different locations (app vs dependencies). If two or more files for the same locale share the same priority, resolution is ambiguous and MessageBundleException is thrown.

Source

Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java:1645

        }
    }

    private void checkForDuplicates(Map<String, List<MessageFile>> groupByName) {
        // Check for duplicates
        // If there are multiple message files of the same priority then fail the build
        for (var entry : groupByName.entrySet()) {
            if (entry.getValue().size() > 1) {
                Map<Integer, List<MessageFile>> groupByPriority = entry.getValue().stream()
                        .collect(Collectors.groupingBy(MessageFile::priority));
                for (var groupEntry : groupByPriority.entrySet()) {
                    if (groupEntry.getValue().size() > 1) {
                        StringBuilder builder = new StringBuilder("Duplicate localized files with priority ")
                                .append(groupEntry.getValue().get(0).priority())
                                .append(" found:\n\t- ")
                                .append(entry.getKey())
                                .append(": ")
                                .append(groupEntry.getValue());
                        throw new MessageBundleException(builder.toString());
                    }
                }
            }
        }
    }

    private List<MessageFile> findMessageFiles(ApplicationArchivesBuildItem applicationArchives,
            BuildProducer<HotDeploymentWatchedFileBuildItem> watchedFiles) throws IOException {

        List<MessageFile> messageFiles = new ArrayList<>();

        addMessageFiles(applicationArchives.getRootArchive(), 10, messageFiles);
        for (ApplicationArchive archive : applicationArchives.getArchives()) {
            addMessageFiles(archive, 1, messageFiles);
        }

        if (messageFiles.isEmpty()) {
            return List.of();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Rename or remove the duplicate file in one of the locations
  2. Move the application's bundle to src/main/resources/messages/ where app files take priority over dependencies
  3. Change the conflicting file's directory so the computed priorities differ
Defensive patterns

Strategy: validation

Validate before calling

// Detect duplicate message resources on classpath
Enumeration<URL> urls = clazz.getClassLoader().getResources("messages_en.properties");
List<URL> all = Collections.list(urls);
if (all.size() > 1) throw new IllegalStateException("Duplicate message files: " + all);

Prevention

When it happens

Trigger: Two message files for the same locale with identical priority exist on the classpath, e.g. messages_en.properties in the application and in an included dependency/jar, both with the same effective priority.

Common situations: Vendor/dependency JARs shipping message bundles that collide with the app's own bundles; copying bundle files between modules; duplicated resource paths after a refactor.

Related errors


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