[Spring Boot] Error - Cannot import javax.validation.constraints

Oguยท2023๋…„ 5์›” 3์ผ
0

SpringBoot

๋ชฉ๋ก ๋ณด๊ธฐ
11/17
post-custom-banner

๐Ÿ˜ฅโ“โ•
form validation์„ ์‹ค์Šตํ•˜๋˜ ๋„์ค‘, javax.validation ํŒจํ‚ค์ง€ import ๋˜์ง€ ์•Š๋Š” ํ˜„์ƒ์ด ๋‚˜ํƒ€๋‚ฌ๋‹ค.
์Šคํ”„๋ง๋ถ€ํŠธ ๋ฒ„์ „ 2.3.0๋ถ€ํ„ฐ๋Š” starter web์— ๋””ํŽœ๋˜์‹œ๋กœ spring-boot-starter-validation ์ด ์ œ์™ธ๋ผ์„œ, ๋ณ„๋„๋กœ ๋””ํŽœ๋˜์‹œ๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•œ๋‹ค

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋””ํŽœ๋˜์‹œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค.

Gradle

build.gradle ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด dependency ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-validation'
}

Maven

pom.xml ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด dependency ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-validation'
}
profile
Hello! I am Ogu, a developer who loves learning and sharing! ๐Ÿค๐Ÿค <br> ใ“ใ‚“ใซใกใฏ๏ผๅญฆใถใ“ใจใจๅ…ฑๆœ‰ใ™ใ‚‹ใ“ใจใŒๅฅฝใใช้–‹็™บ่€…ใฎOguใงใ™๏ผ๐Ÿค
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€