in src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java [510:529]
private void validateArtifactInformation() throws MojoFailureException {
Model model = generateModel();
ModelBuildingRequest request =
new DefaultModelBuildingRequest().setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0);
List<String> result = new ArrayList<>();
SimpleModelProblemCollector problemCollector = new SimpleModelProblemCollector(result);
modelValidator.validateEffectiveModel(model, request, problemCollector);
if (!result.isEmpty()) {
StringBuilder msg = new StringBuilder("The artifact information is incomplete or not valid:\n");
for (String e : result) {
msg.append(" - " + e + '\n');
}
throw new MojoFailureException(msg.toString());
}
}