Skip to content

Enabling Java parameter names

Tip

This is NOT required if you are using Kotlin.

A significant part of the framework benefits from having accessible method parameter names, such as @TextOption or @SlashOption, injecting a service by its name, including better debugging / error messages.

You can add the necessary compiler argument in the configuration for the Maven compiler plugin:

pom.xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${compiler.plugin.version}</version>
    <configuration>
        <!-- ... -->
        <compilerArgs>
            <compilerArg>-parameters</compilerArg>
        </compilerArgs>
    </configuration>
</plugin>

You can add the necessary compiler argument to the Java compile options:

build.gradle.kts
tasks.withType<JavaCompile> {
    options.compilerArgs += "-parameters"
}