quarkusio/quarkus · error · GradleException
Didn't find method
Error message
Didn't find method
What it means
ConfigurationUtils.callGetter reads Quarkus Gradle extension configuration reflectively by invoking a no-arg getter (e.g. getDeploymentModule) on the extension object. If the expected getter method does not exist on the configuration class, it throws a GradleException naming the method and class. This protects against Gradle API shape changes across versions.
Source
Thrown at devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/extension/ConfigurationUtils.java:21
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.gradle.api.GradleException;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
import org.jetbrains.annotations.NotNull;
// This is necessary because in included builds the returned `Project` instance and
// `QuarkusExtensionConfiguration` extension is provided by a different class loader
// which prevents us from creating some interface or casting to it directly.
public class ConfigurationUtils {
private static Object callGetter(@NotNull Object extensionConfiguration, String getterName) {
final Method getterMethod;
try {
getterMethod = extensionConfiguration.getClass().getMethod(getterName);
} catch (NoSuchMethodException e) {
throw new GradleException(
"Didn't find method " + getterName + " on class " + extensionConfiguration.getClass().getName(), e);
}
try {
return getterMethod.invoke(extensionConfiguration);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new GradleException(
"Failed to call method " + getterName + " on class " + extensionConfiguration.getClass().getName(), e);
}
}
@SuppressWarnings("unchecked")
public static Property<String> getDeploymentModule(@NotNull Object extensionConfiguration) {
return (Property<String>) callGetter(extensionConfiguration, "getDeploymentModule");
}
@SuppressWarnings("unchecked")
public static ListProperty<String> getConditionalDependencies(@NotNull Object extensionConfiguration) {View on GitHub (pinned to e1c734241f)
Solutions
- Align Gradle version with the one supported by the Quarkus plugin version (upgrade wrapper or downgrade Quarkus plugin)
- Ensure all subprojects apply the same Quarkus Gradle plugin version
- Remove custom wrappers/replacements of the quarkus extension configuration that omit the expected properties
- Rebuild after a Gradle upgrade so stale plugin jars are replaced
Defensive patterns
Strategy: try-catch
Validate before calling
// check the extension exposes the expected getter before Quarkus reflects on it
def ext = project.extensions.findByName('quarkus')
def expected = ['getDeploymentModule','getConditionalDependencies','getConditionalDevDependencies','getDependencyConditions']
def missing = expected.findAll { m -> !ext?.metaClass?.respondsTo(ext, m) }
if (missing) {
throw new GradleException("Quarkus extension object missing methods: ${missing} — plugin/Gradle version mismatch")
} Try / catch
try {
project.evaluate()
} catch (GradleException e) {
if (e.message?.startsWith('Didn\u0027t find method ')) {
logger.error("Quarkus plugin incompatible with this Gradle version: {}", e.message)
}
throw e
} Prevention
- Keep Quarkus Gradle plugin and Gradle wrapper versions to a documented compatible combination
- Apply the same Quarkus plugin version in every subproject
- Avoid custom extension wrappers that drop expected properties
- Re-run builds cleanly after Gradle major upgrades
When it happens
Trigger: getDeploymentModule, getConditionalDependencies, getConditionalDevDependencies, or getDependencyConditions calls callGetter with a getterName that the runtime extension configuration class does not expose — typically when Gradle's extension object differs from what Quarkus expects.
Common situations: Applying a Quarkus Gradle plugin built for a different Gradle version than the one running; custom/subclassed extension configurations missing expected properties; mixing Quarkus plugin versions in a multi-project build.
Related errors
- Quarkus code generation phase has failed
- Failed to generate sources in the QuarkusGenerateCode task f
- Failed to call method
- Expected : after attribute
- ${methodName} is not a getter
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/0e4be289a7fbd93b.
Report an issue: GitHub.