private void validateArtifactInformation()

in src/main/java/org/apache/maven/plugins/gpg/SignAndDeployFileMojo.java [448:467]


    private void validateArtifactInformation() throws MojoFailureException {
        Model model = generateModel();

        ModelBuildingRequest request =
                new DefaultModelBuildingRequest().setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT);

        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());
        }
    }