Use system line separator wherever possible

This closes #424
This commit is contained in:
Michael Osipov 2020-12-31 00:21:42 +01:00
parent 2caed6218a
commit 31ad2ff43a
16 changed files with 131 additions and 111 deletions

View File

@ -32,6 +32,8 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
public class MultipleArtifactsNotFoundException public class MultipleArtifactsNotFoundException
extends ArtifactResolutionException extends ArtifactResolutionException
{ {
private static final String LS = System.lineSeparator();
private final List<Artifact> resolvedArtifacts; private final List<Artifact> resolvedArtifacts;
private final List<Artifact> missingArtifacts; private final List<Artifact> missingArtifacts;
@ -86,8 +88,8 @@ public class MultipleArtifactsNotFoundException
{ {
StringBuilder buffer = new StringBuilder( 256 ); StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "Missing:\n" ); buffer.append( "Missing:" ).append( LS );
buffer.append( "----------\n" ); buffer.append( "----------" ).append( LS );
int counter = 0; int counter = 0;
@ -100,7 +102,7 @@ public class MultipleArtifactsNotFoundException
artifact.getDownloadUrl(), artifact.getDependencyTrail() ) ); artifact.getDownloadUrl(), artifact.getDependencyTrail() ) );
} }
buffer.append( "----------\n" ); buffer.append( "----------" ).append( LS );
int size = artifacts.size(); int size = artifacts.size();
@ -115,7 +117,7 @@ public class MultipleArtifactsNotFoundException
buffer.append( " is" ); buffer.append( " is" );
} }
buffer.append( " missing.\n\nfor artifact: " ); buffer.append( " missing." ).append( LS ).append( LS ).append( "for artifact: " );
return buffer.toString(); return buffer.toString();
} }

View File

@ -37,6 +37,8 @@ import org.apache.maven.repository.Proxy;
public class MavenArtifactRepository public class MavenArtifactRepository
implements ArtifactRepository implements ArtifactRepository
{ {
private static final String LS = System.lineSeparator();
private String id; private String id;
private String url; private String url;
@ -139,25 +141,25 @@ public class MavenArtifactRepository
{ {
StringBuilder sb = new StringBuilder( 256 ); StringBuilder sb = new StringBuilder( 256 );
sb.append( " id: " ).append( getId() ).append( '\n' ); sb.append( " id: " ).append( getId() ).append( LS );
sb.append( " url: " ).append( getUrl() ).append( '\n' ); sb.append( " url: " ).append( getUrl() ).append( LS );
sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( '\n' ); sb.append( " layout: " ).append( layout != null ? layout : "none" );
if ( proxy != null ) if ( proxy != null )
{ {
sb.append( " proxy: " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '\n' ); sb.append( LS ).append( " proxy: " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );
} }
if ( snapshots != null ) if ( snapshots != null )
{ {
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() ); sb.append( LS ).append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );
sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" ); sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( ']' );
} }
if ( releases != null ) if ( releases != null )
{ {
sb.append( " releases: [enabled => " ).append( releases.isEnabled() ); sb.append( LS ).append( "releases: [enabled => " ).append( releases.isEnabled() );
sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]\n" ); sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( ']' );
} }
return sb.toString(); return sb.toString();

View File

@ -42,6 +42,8 @@ import java.io.Writer;
public abstract class AbstractRepositoryMetadata public abstract class AbstractRepositoryMetadata
implements RepositoryMetadata implements RepositoryMetadata
{ {
private static final String LS = System.lineSeparator();
private Metadata metadata; private Metadata metadata;
protected AbstractRepositoryMetadata( Metadata metadata ) protected AbstractRepositoryMetadata( Metadata metadata )
@ -197,10 +199,10 @@ public abstract class AbstractRepositoryMetadata
{ {
StringBuilder buffer = new StringBuilder( 256 ); StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "\nRepository Metadata\n--------------------------" ); buffer.append( LS ).append( "Repository Metadata" ).append( LS ).append( "--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() ); buffer.append( LS ).append( "GroupId: " ).append( getGroupId() );
buffer.append( "\nArtifactId: " ).append( getArtifactId() ); buffer.append( LS ).append( "ArtifactId: " ).append( getArtifactId() );
buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); buffer.append( LS ).append( "Metadata Type: " ).append( getClass().getName() );
return buffer.toString(); return buffer.toString();
} }

View File

@ -42,6 +42,7 @@ import org.apache.maven.settings.Server;
public class ArtifactResolutionRequest public class ArtifactResolutionRequest
implements RepositoryRequest implements RepositoryRequest
{ {
private static final String LS = System.lineSeparator();
private Artifact artifact; private Artifact artifact;
@ -234,11 +235,11 @@ public class ArtifactResolutionRequest
public String toString() public String toString()
{ {
StringBuilder sb = new StringBuilder() StringBuilder sb = new StringBuilder()
.append( "REQUEST: " ).append( "\n" ) .append( "REQUEST: " ).append( LS )
.append( "artifact: " ).append( artifact ).append( "\n" ) .append( "artifact: " ).append( artifact ).append( LS )
.append( artifactDependencies ).append( "\n" ) .append( artifactDependencies ).append( LS )
.append( "localRepository: " ).append( localRepository ).append( "\n" ) .append( "localRepository: " ).append( localRepository ).append( LS )
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" ); .append( "remoteRepositories: " ).append( remoteRepositories );
return sb.toString(); return sb.toString();
} }

View File

@ -47,6 +47,8 @@ import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
*/ */
public class ArtifactResolutionResult public class ArtifactResolutionResult
{ {
private static final String LS = System.lineSeparator();
private Artifact originatingArtifact; private Artifact originatingArtifact;
private List<Artifact> missingArtifacts; private List<Artifact> missingArtifacts;
@ -359,14 +361,14 @@ public class ArtifactResolutionResult
if ( artifacts != null ) if ( artifacts != null )
{ {
int i = 1; int i = 1;
sb.append( "---------\n" ); sb.append( "---------" ).append( LS );
sb.append( artifacts.size() ).append( '\n' ); sb.append( artifacts.size() ).append( LS );
for ( Artifact a : artifacts ) for ( Artifact a : artifacts )
{ {
sb.append( i ).append( ' ' ).append( a ).append( '\n' ); sb.append( i ).append( ' ' ).append( a ).append( LS );
i++; i++;
} }
sb.append( "---------\n" ); sb.append( "---------" );
} }
return sb.toString(); return sb.toString();

View File

@ -148,9 +148,9 @@ public class DefaultExceptionHandler
return null; return null;
} }
String message = String message = System.lineSeparator()
"\nThe project " + result.getProjectId() + " (" + result.getPomFile() + ") has " + "The project " + result.getProjectId() + " (" + result.getPomFile() + ") has "
+ children.size() + " error" + ( children.size() == 1 ? "" : "s" ); + children.size() + " error" + ( children.size() == 1 ? "" : "s" );
return new ExceptionSummary( null, message, null, children ); return new ExceptionSummary( null, message, null, children );
} }
@ -290,7 +290,7 @@ public class DefaultExceptionHandler
} }
else if ( !exceptionMessage.contains( longMessage ) ) else if ( !exceptionMessage.contains( longMessage ) )
{ {
exceptionMessage = join( exceptionMessage, '\n' + longMessage ); exceptionMessage = join( exceptionMessage, System.lineSeparator() + longMessage );
} }
} }
} }

View File

@ -36,6 +36,8 @@ public class PluginParameterException
extends PluginConfigurationException extends PluginConfigurationException
{ {
private static final String LS = System.lineSeparator();
private final List<Parameter> parameters; private final List<Parameter> parameters;
private final MojoDescriptor mojo; private final MojoDescriptor mojo;
@ -105,50 +107,53 @@ public class PluginParameterException
messageBuffer.append( "Inside the definition for plugin \'" ); messageBuffer.append( "Inside the definition for plugin \'" );
messageBuffer.append( mojo.getPluginDescriptor().getArtifactId() ); messageBuffer.append( mojo.getPluginDescriptor().getArtifactId() );
messageBuffer.append( "\', specify the following:\n\n<configuration>\n ...\n" ); messageBuffer.append( "\', specify the following:" ).append( LS ).append( LS );
messageBuffer.append( "<configuration>" ).append( LS ).append( " ..." ).append( LS );
messageBuffer.append( " <" ).append( param.getName() ).append( '>' ); messageBuffer.append( " <" ).append( param.getName() ).append( '>' );
if ( isArray || isCollection ) if ( isArray || isCollection )
{ {
messageBuffer.append( '\n' ); messageBuffer.append( LS );
messageBuffer.append( " <item>" ); messageBuffer.append( " <item>" );
} }
else if ( isProperties ) else if ( isProperties )
{ {
messageBuffer.append( '\n' ); messageBuffer.append( LS );
messageBuffer.append( " <property>\n" ); messageBuffer.append( " <property>" ).append( LS );
messageBuffer.append( " <name>KEY</name>\n" ); messageBuffer.append( " <name>KEY</name>" ).append( LS );
messageBuffer.append( " <value>" ); messageBuffer.append( " <value>" );
} }
else if ( isMap ) else if ( isMap )
{ {
messageBuffer.append( '\n' ); messageBuffer.append( LS );
messageBuffer.append( " <KEY>" ); messageBuffer.append( " <KEY>" );
} }
messageBuffer.append( "VALUE" ); messageBuffer.append( "VALUE" );
if ( isArray || isCollection ) if ( isArray || isCollection )
{ {
messageBuffer.append( "</item>\n" ); messageBuffer.append( "</item>" ).append( LS );
messageBuffer.append( " " ); messageBuffer.append( " " );
} }
else if ( isProperties ) else if ( isProperties )
{ {
messageBuffer.append( "</value>\n" ); messageBuffer.append( "</value>" ).append( LS );
messageBuffer.append( " </property>\n" ); messageBuffer.append( " </property>" ).append( LS );
messageBuffer.append( " " ); messageBuffer.append( " " );
} }
else if ( isMap ) else if ( isMap )
{ {
messageBuffer.append( "</KEY>\n" ); messageBuffer.append( "</KEY>" ).append( LS );
messageBuffer.append( " " ); messageBuffer.append( " " );
} }
messageBuffer.append( "</" ).append( param.getName() ).append( ">\n" ); messageBuffer.append( "</" ).append( param.getName() ).append( ">" ).append( LS );
messageBuffer.append( "</configuration>" ); messageBuffer.append( "</configuration>" );
String alias = param.getAlias(); String alias = param.getAlias();
if ( StringUtils.isNotEmpty( alias ) && !alias.equals( param.getName() ) ) if ( StringUtils.isNotEmpty( alias ) && !alias.equals( param.getName() ) )
{ {
messageBuffer.append( "\n\n-OR-\n\n<configuration>\n ...\n <" ).append( alias ).append( messageBuffer.append( LS ).append( LS ).append( "-OR-" ).append( LS ).append( LS );
">VALUE</" ).append( alias ).append( ">\n</configuration>\n" ); messageBuffer.append( "<configuration>" ).append( LS ).append( " ..." ).append( LS );
messageBuffer.append( " <" ).append( alias ).append(
">VALUE</" ).append( alias ).append( ">" ).append( LS ).append( "</configuration>" ).append( LS );
} }
} }
@ -160,7 +165,7 @@ public class PluginParameterException
{ {
if ( param.isEditable() ) if ( param.isEditable() )
{ {
messageBuffer.append( "\n\n-OR-\n\n" ); messageBuffer.append( LS ).append( LS ).append( "-OR-" ).append( LS ).append( LS );
} }
//addParameterUsageInfo( expression, messageBuffer ); //addParameterUsageInfo( expression, messageBuffer );
@ -176,18 +181,18 @@ public class PluginParameterException
messageBuffer.append( "One or more required plugin parameters are invalid/missing for \'" ) messageBuffer.append( "One or more required plugin parameters are invalid/missing for \'" )
.append( mojo.getPluginDescriptor().getGoalPrefix() ).append( ':' ).append( mojo.getGoal() ) .append( mojo.getPluginDescriptor().getGoalPrefix() ).append( ':' ).append( mojo.getGoal() )
.append( "\'\n" ); .append( "\'" ).append( LS );
int idx = 0; int idx = 0;
for ( Iterator<Parameter> it = params.iterator(); it.hasNext(); idx++ ) for ( Iterator<Parameter> it = params.iterator(); it.hasNext(); idx++ )
{ {
Parameter param = it.next(); Parameter param = it.next();
messageBuffer.append( "\n[" ).append( idx ).append( "] " ); messageBuffer.append( LS ).append( "[" ).append( idx ).append( "] " );
decomposeParameterIntoUserInstructions( mojo, param, messageBuffer ); decomposeParameterIntoUserInstructions( mojo, param, messageBuffer );
messageBuffer.append( '\n' ); messageBuffer.append( LS );
} }
return messageBuffer.toString(); return messageBuffer.toString();

View File

@ -291,7 +291,7 @@ public class ActiveProjectArtifact
/** {@inheritDoc} */ /** {@inheritDoc} */
public String toString() public String toString()
{ {
return "active project artifact:\n\tartifact = " + artifact + ";\n\tproject: " + project; return "active project artifact[artifact: " + artifact + ", project: " + project + "]";
} }
/** {@inheritDoc} */ /** {@inheritDoc} */

View File

@ -688,23 +688,23 @@ public class MavenMetadataSource
} }
String message = String message =
"\n This artifact has been relocated to " + artifact.getGroupId() + ":" " this artifact has been relocated to " + artifact.getGroupId() + ":"
+ artifact.getArtifactId() + ":" + artifact.getVersion() + ".\n"; + artifact.getArtifactId() + ":" + artifact.getVersion() + ".";
if ( relocation.getMessage() != null ) if ( relocation.getMessage() != null )
{ {
message += " " + relocation.getMessage() + "\n"; message += " " + relocation.getMessage();
} }
if ( artifact.getDependencyTrail() != null && artifact.getDependencyTrail().size() == 1 ) if ( artifact.getDependencyTrail() != null && artifact.getDependencyTrail().size() == 1 )
{ {
logger.warn( "While downloading " + pomArtifact.getGroupId() + ":" logger.warn( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" ); + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message );
} }
else else
{ {
logger.debug( "While downloading " + pomArtifact.getGroupId() + ":" logger.debug( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" ); + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message );
} }
} }
else else

View File

@ -29,6 +29,8 @@ import org.apache.maven.artifact.Artifact;
public abstract class AbstractArtifactMetadata public abstract class AbstractArtifactMetadata
implements ArtifactMetadata implements ArtifactMetadata
{ {
private static final String LS = System.lineSeparator();
protected Artifact artifact; protected Artifact artifact;
protected AbstractArtifactMetadata( Artifact artifact ) protected AbstractArtifactMetadata( Artifact artifact )
@ -55,10 +57,10 @@ public abstract class AbstractArtifactMetadata
{ {
StringBuilder buffer = new StringBuilder( 256 ); StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "\nArtifact Metadata\n--------------------------" ); buffer.append( LS ).append( "Artifact Metadata" ).append( LS ).append( "--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() ); buffer.append( LS ).append( "GroupId: " ).append( getGroupId() );
buffer.append( "\nArtifactId: " ).append( getArtifactId() ); buffer.append( LS ).append( "ArtifactId: " ).append( getArtifactId() );
buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); buffer.append( LS ).append( "Metadata Type: " ).append( getClass().getName() );
return buffer.toString(); return buffer.toString();
} }

View File

@ -43,8 +43,8 @@ public class SettingsConfigurationException
public SettingsConfigurationException( String message, Throwable cause, int lineNumber, int columnNumber ) public SettingsConfigurationException( String message, Throwable cause, int lineNumber, int columnNumber )
{ {
super( message + ( lineNumber > 0 ? "\n Line: " + lineNumber : "" ) super( message + ( lineNumber > 0 ? System.lineSeparator() + " Line: " + lineNumber : "" )
+ ( columnNumber > 0 ? "\n Column: " + columnNumber : "" ), cause ); + ( columnNumber > 0 ? System.lineSeparator() + " Column: " + columnNumber : "" ), cause );
this.lineNumber = lineNumber; this.lineNumber = lineNumber;
this.columnNumber = columnNumber; this.columnNumber = columnNumber;
} }

View File

@ -37,6 +37,8 @@ public class PluginParameterExceptionTest
extends TestCase extends TestCase
{ {
private final String LS = System.lineSeparator();
public void testMissingRequiredStringArrayTypeParameter() public void testMissingRequiredStringArrayTypeParameter()
{ {
MojoDescriptor mojoDescriptor = new MojoDescriptor(); MojoDescriptor mojoDescriptor = new MojoDescriptor();
@ -55,16 +57,16 @@ public class PluginParameterExceptionTest
PluginParameterException exception = PluginParameterException exception =
new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) );
assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'" +
"\n" + LS + LS +
"[0] Inside the definition for plugin 'artifactId', specify the following:\n" + "[0] Inside the definition for plugin 'artifactId', specify the following:" +
"\n" + LS + LS +
"<configuration>\n" + "<configuration>" + LS +
" ...\n" + " ..." + LS +
" <toAddresses>\n" + " <toAddresses>" + LS +
" <item>VALUE</item>\n" + " <item>VALUE</item>" + LS +
" </toAddresses>\n" + " </toAddresses>" + LS +
"</configuration>.\n", exception.buildDiagnosticMessage() ); "</configuration>." + LS, exception.buildDiagnosticMessage() );
} }
public void testMissingRequiredCollectionTypeParameter() public void testMissingRequiredCollectionTypeParameter()
@ -85,16 +87,16 @@ public class PluginParameterExceptionTest
PluginParameterException exception = PluginParameterException exception =
new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) );
assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'" +
"\n" + LS + LS +
"[0] Inside the definition for plugin 'artifactId', specify the following:\n" + "[0] Inside the definition for plugin 'artifactId', specify the following:" +
"\n" + LS + LS +
"<configuration>\n" + "<configuration>" + LS +
" ...\n" + " ..." + LS +
" <toAddresses>\n" + " <toAddresses>" + LS +
" <item>VALUE</item>\n" + " <item>VALUE</item>" + LS +
" </toAddresses>\n" + " </toAddresses>" + LS +
"</configuration>.\n", exception.buildDiagnosticMessage() ); "</configuration>." + LS, exception.buildDiagnosticMessage() );
} }
public void testMissingRequiredMapTypeParameter() public void testMissingRequiredMapTypeParameter()
@ -115,16 +117,16 @@ public class PluginParameterExceptionTest
PluginParameterException exception = PluginParameterException exception =
new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) );
assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'" +
"\n" + LS + LS +
"[0] Inside the definition for plugin 'artifactId', specify the following:\n" + "[0] Inside the definition for plugin 'artifactId', specify the following:" +
"\n" + LS + LS +
"<configuration>\n" + "<configuration>" + LS +
" ...\n" + " ..." + LS +
" <toAddresses>\n" + " <toAddresses>" + LS +
" <KEY>VALUE</KEY>\n" + " <KEY>VALUE</KEY>" + LS +
" </toAddresses>\n" + " </toAddresses>" + LS +
"</configuration>.\n", exception.buildDiagnosticMessage() ); "</configuration>." + LS, exception.buildDiagnosticMessage() );
} }
public void testMissingRequiredPropertiesTypeParameter() public void testMissingRequiredPropertiesTypeParameter()
@ -145,20 +147,19 @@ public class PluginParameterExceptionTest
PluginParameterException exception = PluginParameterException exception =
new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) );
assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'" +
"\n" + LS + LS +
"[0] Inside the definition for plugin 'artifactId', specify the following:\n" + "[0] Inside the definition for plugin 'artifactId', specify the following:" +
"\n" + LS + LS +
"<configuration>\n" + "<configuration>" + LS +
" ...\n" + " ..." + LS +
" <toAddresses>\n" + " <toAddresses>" + LS +
" <property>\n" + " <property>" + LS +
" <name>KEY</name>\n" + " <name>KEY</name>" + LS +
" <value>VALUE</value>\n" + " <value>VALUE</value>" + LS +
" </property>\n" + " </property>" + LS +
" </toAddresses>\n" + " </toAddresses>" + LS +
"</configuration>.\n", exception.buildDiagnosticMessage() ); "</configuration>." + LS, exception.buildDiagnosticMessage() );
} }
} }

View File

@ -176,8 +176,10 @@ public class CLIManager
HelpFormatter formatter = new HelpFormatter(); HelpFormatter formatter = new HelpFormatter();
formatter.printHelp( pw, HelpFormatter.DEFAULT_WIDTH, "mvn [options] [<goal(s)>] [<phase(s)>]", "\nOptions:", formatter.printHelp( pw, HelpFormatter.DEFAULT_WIDTH, "mvn [options] [<goal(s)>] [<phase(s)>]",
options, HelpFormatter.DEFAULT_LEFT_PAD, HelpFormatter.DEFAULT_DESC_PAD, "\n", false ); System.lineSeparator() + "Options:", options,
HelpFormatter.DEFAULT_LEFT_PAD, HelpFormatter.DEFAULT_DESC_PAD,
System.lineSeparator(), false );
pw.flush(); pw.flush();
} }

View File

@ -1231,7 +1231,7 @@ public class MavenCli
// There are too many ConfigurationProcessors so we don't know which one to run so report the error. // There are too many ConfigurationProcessors so we don't know which one to run so report the error.
// //
StringBuilder sb = new StringBuilder( StringBuilder sb = new StringBuilder(
String.format( "\nThere can only be one user supplied ConfigurationProcessor, there are %s:\n\n", String.format( "%nThere can only be one user supplied ConfigurationProcessor, there are %s:%n%n",
userSuppliedConfigurationProcessorCount ) ); userSuppliedConfigurationProcessorCount ) );
for ( Entry<String, ConfigurationProcessor> entry : configurationProcessors.entrySet() ) for ( Entry<String, ConfigurationProcessor> entry : configurationProcessors.entrySet() )
{ {
@ -1239,10 +1239,9 @@ public class MavenCli
if ( !hint.equals( SettingsXmlConfigurationProcessor.HINT ) ) if ( !hint.equals( SettingsXmlConfigurationProcessor.HINT ) )
{ {
ConfigurationProcessor configurationProcessor = entry.getValue(); ConfigurationProcessor configurationProcessor = entry.getValue();
sb.append( String.format( "%s\n", configurationProcessor.getClass().getName() ) ); sb.append( String.format( "%s%n", configurationProcessor.getClass().getName() ) );
} }
} }
sb.append( "\n" );
throw new Exception( sb.toString() ); throw new Exception( sb.toString() );
} }
} }

View File

@ -30,8 +30,8 @@ public class DuplicateMojoDescriptorException
String newImplementation ) String newImplementation )
{ {
super( "Goal: " + goal + " already exists in the plugin descriptor for prefix: " + goalPrefix super( "Goal: " + goal + " already exists in the plugin descriptor for prefix: " + goalPrefix
+ "\nExisting implementation is: " + existingImplementation + System.lineSeparator() + "Existing implementation is: " + existingImplementation
+ "\nConflicting implementation is: " + newImplementation ); + System.lineSeparator() + "Conflicting implementation is: " + newImplementation );
} }
} }

View File

@ -123,7 +123,8 @@ public class SystemStreamLog
error.printStackTrace( pWriter ); error.printStackTrace( pWriter );
System.err.println( "[error] " + content.toString() + "\n\n" + sWriter.toString() ); System.err.println( "[error] " + content.toString()
+ System.lineSeparator() + System.lineSeparator() + sWriter.toString() );
} }
/** /**
@ -194,6 +195,7 @@ public class SystemStreamLog
error.printStackTrace( pWriter ); error.printStackTrace( pWriter );
System.out.println( "[" + prefix + "] " + content.toString() + "\n\n" + sWriter.toString() ); System.out.println( "[" + prefix + "] " + content.toString()
+ System.lineSeparator() + System.lineSeparator() + sWriter.toString() );
} }
} }