org.apache.maven.model.building.ModelProblemCollectorRequest Java Examples

The following examples show how to use org.apache.maven.model.building.ModelProblemCollectorRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MavenSettings.java    From spring-init with Apache License 2.0 5 votes vote down vote up
private String createFailureMessage(
		SpringBootCliModelProblemCollector problemCollector) {
	StringWriter message = new StringWriter();
	PrintWriter printer = new PrintWriter(message);
	printer.println("Failed to determine active profiles:");
	for (ModelProblemCollectorRequest problem : problemCollector.getProblems()) {
		printer.println("    " + problem.getMessage() + (problem.getLocation() != null
				? " at " + problem.getLocation() : ""));
		if (problem.getException() != null) {
			printer.println(indentStackTrace(problem.getException(), "        "));
		}
	}
	return message.toString();
}
 
Example #2
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 5 votes vote down vote up
private String createFailureMessage(
		SpringBootCliModelProblemCollector problemCollector) {
	StringWriter message = new StringWriter();
	PrintWriter printer = new PrintWriter(message);
	printer.println("Failed to determine active profiles:");
	for (ModelProblemCollectorRequest problem : problemCollector.getProblems()) {
		printer.println("    " + problem.getMessage() + (problem.getLocation() != null
				? " at " + problem.getLocation() : ""));
		if (problem.getException() != null) {
			printer.println(indentStackTrace(problem.getException(), "        "));
		}
	}
	return message.toString();
}
 
Example #3
Source File: CiModelInterpolator.java    From flatten-maven-plugin with Apache License 2.0 5 votes vote down vote up
public Object getValue(String expression) {
	Object value = valueSource.getValue(expression);

	if (value != null && expression.startsWith(bannedPrefix)) {
		String msg = "The expression ${" + expression + "} is deprecated.";
		if (newPrefix != null && newPrefix.length() > 0) {
			msg += " Please use ${" + newPrefix + expression.substring(bannedPrefix.length()) + "} instead.";
		}
		problems.add(new ModelProblemCollectorRequest(Severity.WARNING, Version.V20).setMessage(msg));
	}

	return value;
}
 
Example #4
Source File: MavenSettings.java    From spring-init with Apache License 2.0 4 votes vote down vote up
@Override
public void add(ModelProblemCollectorRequest req) {
	this.problems.add(req);
}
 
Example #5
Source File: MavenSettings.java    From spring-init with Apache License 2.0 4 votes vote down vote up
List<ModelProblemCollectorRequest> getProblems() {
	return this.problems;
}
 
Example #6
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 4 votes vote down vote up
@Override
public void add(ModelProblemCollectorRequest req) {
	this.problems.add(req);
}
 
Example #7
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 4 votes vote down vote up
List<ModelProblemCollectorRequest> getProblems() {
	return this.problems;
}
 
Example #8
Source File: LoggingModelProblemCollector.java    From flatten-maven-plugin with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void add( ModelProblemCollectorRequest req )
{
    this.logger.warn( req.getMessage(), req.getException() );
}