List of usage examples for org.apache.maven.project.validation ModelValidationResult render
public String render(String indentation)
From source file:lu.softec.maven.mavenizer.mavenfile.internal.DefaultMavenFileFactory.java
License:Open Source License
/** * Validate coordinates of a {@link MavenFile} using the {@link ModelValidator} * * @param file {@link MavenFile} to be validated * @throws InvalidMavenCoordinatesException when validation fails *///from w w w. java 2 s . c o m private void validateArtifactInformation(MavenFile file) throws InvalidMavenCoordinatesException { Model model = file.getMinimalModel(); ModelValidationResult result = modelValidator.validate(model); if (result.getMessageCount() > 0) { throw new InvalidMavenCoordinatesException( "Coordinates are incomplete or not valid:\n" + result.render(" ")); } }
From source file:net.md_5.specialsource.mavenplugin.InstallRemappedFileMojo.java
License:Apache License
/** * Validates the user-supplied artifact information. * * @throws MojoExecutionException If any artifact coordinate is invalid. *//*from w w w . j ava2 s. c o m*/ private void validateArtifactInformation() throws MojoExecutionException { Model model = generateModel(); ModelValidationResult result = modelValidator.validate(model); if (result.getMessageCount() > 0) { throw new MojoExecutionException( "The artifact information is incomplete or not valid:\n" + result.render(" ")); } }