use of org.apache.maven.model.building.SimpleProblemCollector in project maven by apache.
the class DefaultModelValidatorTest method testBadPluginVersion.
@Test
public void testBadPluginVersion() throws Exception {
SimpleProblemCollector result = validate("bad-plugin-version.xml");
assertViolations(result, 0, 4, 0);
assertContains(result.getErrors().get(0), "'build.plugins.plugin.version' for test:mip must be a valid version");
assertContains(result.getErrors().get(1), "'build.plugins.plugin.version' for test:rmv must be a valid version");
assertContains(result.getErrors().get(2), "'build.plugins.plugin.version' for test:lmv must be a valid version");
assertContains(result.getErrors().get(3), "'build.plugins.plugin.version' for test:ifsc must not contain any of these characters");
}
use of org.apache.maven.model.building.SimpleProblemCollector in project maven by apache.
the class DefaultModelValidatorTest method testBadSnapshotVersion.
@Test
public void testBadSnapshotVersion() throws Exception {
SimpleProblemCollector result = validate("bad-snapshot-version.xml");
assertViolations(result, 0, 1, 0);
assertContains(result.getErrors().get(0), "'version' uses an unsupported snapshot version format");
}
use of org.apache.maven.model.building.SimpleProblemCollector in project maven by apache.
the class DefaultModelValidatorTest method testDeprecatedDependencyMetaversionsLatestAndRelease.
@Test
public void testDeprecatedDependencyMetaversionsLatestAndRelease() throws Exception {
SimpleProblemCollector result = validateRaw("deprecated-dependency-metaversions-latest-and-release.xml");
assertViolations(result, 0, 0, 2);
assertContains(result.getWarnings().get(0), "'dependencies.dependency.version' for test:a:jar is either LATEST or RELEASE (both of them are being deprecated)");
assertContains(result.getWarnings().get(1), "'dependencies.dependency.version' for test:b:jar is either LATEST or RELEASE (both of them are being deprecated)");
}
use of org.apache.maven.model.building.SimpleProblemCollector in project maven by apache.
the class DefaultModelValidatorTest method testSystemPathRefersToProjectBasedir.
@Test
public void testSystemPathRefersToProjectBasedir() throws Exception {
SimpleProblemCollector result = validateRaw("basedir-system-path.xml");
assertViolations(result, 0, 0, 4);
assertContains(result.getWarnings().get(0), "'dependencies.dependency.scope' for test:a:jar declares usage of deprecated 'system' scope");
assertContains(result.getWarnings().get(1), "'dependencies.dependency.systemPath' for test:a:jar should not point at files within the project directory");
assertContains(result.getWarnings().get(2), "'dependencies.dependency.scope' for test:b:jar declares usage of deprecated 'system' scope");
assertContains(result.getWarnings().get(3), "'dependencies.dependency.systemPath' for test:b:jar should not point at files within the project directory");
}
use of org.apache.maven.model.building.SimpleProblemCollector in project maven by apache.
the class DefaultModelValidatorTest method testInvalidAggregatorPackaging.
@Test
public void testInvalidAggregatorPackaging() throws Exception {
SimpleProblemCollector result = validate("invalid-aggregator-packaging-pom.xml");
assertViolations(result, 0, 1, 0);
assertTrue(result.getErrors().get(0).contains("Aggregator projects require 'pom' as packaging."));
}
Aggregations