{"record":{"id":"fbf6cb4d5ed37ab4","repo":"quarkusio/quarkus","slug":"duplicate-localized-files-with-priority-priority","errorCode":null,"errorMessage":"Duplicate localized files with priority {priority} found:\n\t- {locale}: {files}","messagePattern":"Duplicate localized files with priority (.+?) found:\n\t- (.+?): (.+?)","errorType":"exception","errorClass":"MessageBundleException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java","lineNumber":1645,"sourceCode":"        }\n    }\n\n    private void checkForDuplicates(Map<String, List<MessageFile>> groupByName) {\n        // Check for duplicates\n        // If there are multiple message files of the same priority then fail the build\n        for (var entry : groupByName.entrySet()) {\n            if (entry.getValue().size() > 1) {\n                Map<Integer, List<MessageFile>> groupByPriority = entry.getValue().stream()\n                        .collect(Collectors.groupingBy(MessageFile::priority));\n                for (var groupEntry : groupByPriority.entrySet()) {\n                    if (groupEntry.getValue().size() > 1) {\n                        StringBuilder builder = new StringBuilder(\"Duplicate localized files with priority \")\n                                .append(groupEntry.getValue().get(0).priority())\n                                .append(\" found:\\n\\t- \")\n                                .append(entry.getKey())\n                                .append(\": \")\n                                .append(groupEntry.getValue());\n                        throw new MessageBundleException(builder.toString());\n                    }\n                }\n            }\n        }\n    }\n\n    private List<MessageFile> findMessageFiles(ApplicationArchivesBuildItem applicationArchives,\n            BuildProducer<HotDeploymentWatchedFileBuildItem> watchedFiles) throws IOException {\n\n        List<MessageFile> messageFiles = new ArrayList<>();\n\n        addMessageFiles(applicationArchives.getRootArchive(), 10, messageFiles);\n        for (ApplicationArchive archive : applicationArchives.getArchives()) {\n            addMessageFiles(archive, 1, messageFiles);\n        }\n\n        if (messageFiles.isEmpty()) {\n            return List.of();","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java#L1627-L1663","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rename or remove the duplicate file in one of the locations","Move the application's bundle to src/main/resources/messages/ where app files take priority over dependencies","Change the conflicting file's directory so the computed priorities differ"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Detect duplicate message resources on classpath\nEnumeration<URL> urls = clazz.getClassLoader().getResources(\"messages_en.properties\");\nList<URL> all = Collections.list(urls);\nif (all.size() > 1) throw new IllegalStateException(\"Duplicate message files: \" + all);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit dependency JARs for bundled message files","Keep app bundles under src/main/resources/messages/ to win priority","Use unique bundle names per module"],"tags":["qute","message-bundle","i18n","classpath-conflict"],"backgroundTag":"duplicate-classpath-resource","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}