spring-projects / spring-projects/spring-data-commons
AOT repository generation emits invalid @Constraint annotation alongside jakarta.validation.constraints.* parameters
@christophstrobl is already working on this.
Since Jun 10, 2026.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
In our Spring Boot project, we do have a Spring AOT configuration that used to work with 4.0.3, but started failing after 4.0.6.
Example of repository:
import jakarta.validation.constraints.NotNull;
import java.util.List;
import java.util.UUID;
import org.springframework.data.jpa.repository.JpaRepository;
public interface BananaRepository extends JpaRepository<Banana, UUID> {
List<Banana> findAllByStoreUuid(
@NotNull UUID storeUuid
);
}
Error during maven process-aot:
[ERROR] annotation @jakarta.validation.Constraint is missing a default value for the element 'validatedBy'
To reproduce, please run: mvn -B -q package -DskipTests with spring-repository-aot-issue.zip
We can argue about the usage of the validation annotation, but still, I believe this should be supported.
For now, we just removed them to fix the problem.
It might relates to https://github.com/spring-projects/spring-data-commons/commit/852d789de7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.