parameter names cannot be discivered.
Ensure that the comoiler uses the '-parameters' flag 오류 발생시 해결책


스프링 프레임워크 6.x / 스프링 부트 3.x 이상부터는 더 이상 LocalVariableTableParameterNameDiscoverer를 사용하지 않으므로,
Java 컴파일 시 -parameters 플래그가 필수입니다.

1. build.gradle에 옵션 추가

compileJava {
    options.compilerArgs << '-parameters'
}


tasks.withType<JavaComoiler>() {
    options.compilerArgs.add("-parameters")
}
tasks.withType(JavaCompile) {
    options.compilerArgs.add("-parameters")
}


tasks.withType(JavaCompiler).configureEach {
    options.compilerArgs.add("-parameters")
}




2.  maven

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <parameters>true</parameters>
            </configuration>
        </plugin>
    </plugins>
</build>



2. IDE 설정 변경 (Eclipse / STS 기준)
화면의 Eclipse/STS 환경에서 IDE 내 컴파일 설정을 변경해야 합니다.
Eclipse 상단 메뉴 Window > Preferences 이동
Java > Compiler 선택
"Store information about method parameters (usable via reflection" 항목 체크
Apply and Close 클릭 후 프로젝트 재빌드 (Project -> Clean...)




'spring-boot' 카테고리의 다른 글

비동기 - Async/nonblocking  (0) 2026.02.05
@ConfigurationProperties 메소드에 사용  (0) 2025.09.04
@Conditional 조건별 Bean 생성  (0) 2025.04.29
RestClient  (0) 2024.10.05
Serve Static Resources with Spring  (0) 2024.09.27
Posted by 張's blog
,