spring-projects / spring-projects/spring-data-commons

AOT repository generation emits invalid @Constraint annotation alongside jakarta.validation.constraints.* parameters

Open
#3,499 1 comment 0 reactions 1 assignee View on GitHub

@christophstrobl is already working on this.

Since Jun 10, 2026.

type: regression
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.