Skip to content

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

@LoganWlv

Description

@LoganWlv

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 852d789de7

Metadata

Metadata

Labels

type: regressionA regression from a previous release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions