MavenArtifactIdLowercaseValidator implements MavenArtifactCoordinatesValidator { @Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getArtifactId().toLowerCase().equals(mac.getArtifactId())) { throw new LowercaseValidationException("The artifactId should be defined in lowercase."); } }  @PostConstruct @Override void register(); @Override String getAlias(); @Override String getDescription(); @Override void validate(Repository repository,
                         ArtifactCoordinates coordinates); RepositoryFileAttributes getAttributes(RepositoryPath repositoryPath); static final String ALIAS; static final String DESCRIPTION; }
@ExtendWith({ RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class }) @Test public void validateGroupIdCase(@MavenRepository(repositoryId = REPOSITORY_RELEASES) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES, id = GROUP_ID + ":" + ARTIFACT_ID, versions = { "1.0" }) Path path) throws Exception { RepositoryPath repositoryPath = (RepositoryPath) path.normalize(); ArtifactCoordinates coordinates = RepositoryFiles.readCoordinates(repositoryPath); assertThatExceptionOfType(LowercaseValidationException.class) .isThrownBy(() -> mavenArtifactIdLowercaseValidator.validate(repository, coordinates)); }