{"record":{"id":"7f3eda6c28fafcac","repo":"apache/maven","slug":"could-not-find-compatible-version-of-plugin","errorCode":null,"errorMessage":"Could not find compatible version of plugin {}:{} in any plugin repository","messagePattern":"Could not find compatible version of plugin (.+?):(.+?) in any plugin repository","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java","lineNumber":257,"sourceCode":"                version = selectCompatible(request, preReleases, \"PRE-RELEASE\");\n            }\n            if (version == null) {\n                version = selectCompatible(request, snapshots, \"SNAPSHOT\");\n            }\n            if (version != null) {\n                repo = versions.versions.get(version);\n            }\n        }\n\n        if (version != null) {\n            // if LATEST worked out of the box, remain silent as today, otherwise inform user about search result\n            if (searchPerformed) {\n                logger.info(\"Selected plugin {}:{}:{}\", request.getGroupId(), request.getArtifactId(), version);\n            }\n            result.setVersion(version);\n            result.setRepository(repo);\n        } else {\n            logger.warn(\n                    resolvedPluginVersions\n                            ? \"Could not find compatible version of plugin {}:{} in any plugin repository\"\n                            : \"Plugin {}:{} not found in any plugin repository\",\n                    request.getGroupId(),\n                    request.getArtifactId());\n            throw new PluginVersionResolutionException(\n                    request.getGroupId(),\n                    request.getArtifactId(),\n                    request.getRepositorySession().getLocalRepository(),\n                    request.getRepositories(),\n                    resolvedPluginVersions\n                            ? \"Could not find compatible plugin version in any plugin repository\"\n                            : \"Plugin not found in any plugin repository\");\n        }\n    }\n\n    /**\n     * Returns the newest version of {@code candidates} that passes {@link #isCompatible}, or {@code null}.","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java#L239-L275","documentation":"Terminal failure of unversioned plugin resolution. A goal was invoked or a POM declared a plugin without a version, so DefaultPluginVersionResolver merged maven-metadata.xml from the configured plugin repositories; versions DID exist (resolvedPluginVersions == true), but every candidate was rejected - RELEASE/LATEST was unusable or incompatible and each version from the metadata failed the isCompatible probe (descriptor load or Maven prerequisite check). After this warning Maven throws PluginVersionResolutionException ('Could not find compatible plugin version in any plugin repository') and the build fails.","triggerScenarios":"mvn groupId:artifactId:goal (or a <plugin> without <version>) where repository metadata lists versions but all fail compatibility - e.g. every release of the plugin requires a newer Maven than the running one, or all candidate descriptors fail to load. Follow the log upward: 'Ignoring incompatible plugin version X' lines show which candidates were skipped.","commonSituations":"Running an older Maven (3.8/3.9) against plugins whose newest line requires Maven 4 with no older release matching the metadata path; metadata listing only versions whose artifacts were deleted; proxies serving stale maven-metadata.xml.","solutions":["Pin an explicit, known-good version: <version> in <pluginManagement> for POM usage, or groupId:artifactId:version:goal on the CLI - this bypasses version search entirely","Read the preceding 'Ignoring incompatible plugin version' warnings: if all candidates demand a newer Maven, upgrade the Maven distribution to satisfy them","If an older compatible version exists but is not being reached, refresh metadata with -U or fix the repository/proxy serving maven-metadata.xml","Verify the artifact path really contains deployable versions: check maven-metadata.xml under the plugin's group/artifact directory in your repository manager"],"exampleFix":"<!-- before: no version, resolver must search and fails -->\n<plugin>\n  <groupId>org.apache.maven.plugins</groupId>\n  <artifactId>maven-compiler-plugin</artifactId>\n</plugin>\n<!-- after: pinned compatible version -->\n<plugin>\n  <groupId>org.apache.maven.plugins</groupId>\n  <artifactId>maven-compiler-plugin</artifactId>\n  <version>3.13.0</version>\n</plugin>","handlingStrategy":"try-catch","validationCode":"# preflight: confirm the plugin exists and exposes versions before building unversioned\nrepo=https://repo1.maven.org/maven2\ncurl -fsSL \"$repo/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml\" >/dev/null && echo metadata-ok","typeGuard":null,"tryCatchPattern":"// embedding Maven: catch the resolution failure and fall back to a pinned version\ntry {\n    PluginVersionResult r = pluginVersionResolver.resolve(request);\n    plugin.setVersion(r.getVersion());\n} catch (PluginVersionResolutionException e) {\n    plugin.setVersion(\"3.13.0\"); // known-good fallback instead of failing the build\n}","preventionTips":["Never rely on implicit plugin version resolution in production builds - pin versions in pluginManagement","Add non-default plugin groups to <pluginGroups> in settings.xml or always use full coordinates","After deploying a new plugin version, verify maven-metadata.xml updated in the repository manager"],"tags":["maven","plugin-version-resolution","metadata","compatibility"],"backgroundTag":"plugin-version-resolution-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}