Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
public class MultipleArtifactsNotFoundException
extends ArtifactResolutionException
{
private static final String LS = System.lineSeparator();

private final List<Artifact> resolvedArtifacts;
private final List<Artifact> missingArtifacts;

Expand Down Expand Up @@ -86,8 +88,8 @@ private static String constructMessage( List<Artifact> artifacts )
{
StringBuilder buffer = new StringBuilder( 256 );

buffer.append( "Missing:\n" );
buffer.append( "----------\n" );
buffer.append( "Missing:" ).append( LS );
buffer.append( "----------" ).append( LS );

int counter = 0;

Expand All @@ -100,7 +102,7 @@ private static String constructMessage( List<Artifact> artifacts )
artifact.getDownloadUrl(), artifact.getDependencyTrail() ) );
}

buffer.append( "----------\n" );
buffer.append( "----------" ).append( LS );

int size = artifacts.size();

Expand All @@ -115,7 +117,7 @@ private static String constructMessage( List<Artifact> artifacts )
buffer.append( " is" );
}

buffer.append( " missing.\n\nfor artifact: " );
buffer.append( " missing." ).append( LS ).append( LS ).append( "for artifact: " );

return buffer.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
public class MavenArtifactRepository
implements ArtifactRepository
{
private static final String LS = System.lineSeparator();

private String id;

private String url;
Expand Down Expand Up @@ -139,25 +141,25 @@ public String toString()
{
StringBuilder sb = new StringBuilder( 256 );

sb.append( " id: " ).append( getId() ).append( '\n' );
sb.append( " url: " ).append( getUrl() ).append( '\n' );
sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( '\n' );
sb.append( " id: " ).append( getId() ).append( LS );
sb.append( " url: " ).append( getUrl() ).append( LS );
sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( LS );

if ( proxy != null )
{
sb.append( " proxy: " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '\n' );
sb.append( " proxy: " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( LS );
}

if ( snapshots != null )
{
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );
sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" );
sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]" ).append( LS );
}

if ( releases != null )
{
sb.append( " releases: [enabled => " ).append( releases.isEnabled() );
sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]\n" );
sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]" );
}

return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
public abstract class AbstractRepositoryMetadata
implements RepositoryMetadata
{
private static final String LS = System.lineSeparator();

private Metadata metadata;

protected AbstractRepositoryMetadata( Metadata metadata )
Expand Down Expand Up @@ -197,10 +199,10 @@ public String extendedToString()
{
StringBuilder buffer = new StringBuilder( 256 );

buffer.append( "\nRepository Metadata\n--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() );
buffer.append( "\nArtifactId: " ).append( getArtifactId() );
buffer.append( "\nMetadata Type: " ).append( getClass().getName() );
buffer.append( LS ).append( "Repository Metadata" ).append( LS ).append( "--------------------------" );
buffer.append( LS ).append( "GroupId: " ).append( getGroupId() );
buffer.append( LS ).append( "ArtifactId: " ).append( getArtifactId() );
buffer.append( LS ).append( "Metadata Type: " ).append( getClass().getName() );

return buffer.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public class ArtifactResolutionRequest
implements RepositoryRequest
{
private static final String LS = System.lineSeparator();

private Artifact artifact;

Expand Down Expand Up @@ -234,11 +235,11 @@ public boolean isResolveTransitively()
public String toString()
{
StringBuilder sb = new StringBuilder()
.append( "REQUEST: " ).append( "\n" )
.append( "artifact: " ).append( artifact ).append( "\n" )
.append( artifactDependencies ).append( "\n" )
.append( "localRepository: " ).append( localRepository ).append( "\n" )
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" );
.append( "REQUEST: " ).append( LS )
.append( "artifact: " ).append( artifact ).append( LS )
.append( artifactDependencies ).append( LS )
.append( "localRepository: " ).append( localRepository ).append( LS )
.append( "remoteRepositories: " ).append( remoteRepositories );

return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
*/
public class ArtifactResolutionResult
{
private static final String LS = System.lineSeparator();

private Artifact originatingArtifact;

private List<Artifact> missingArtifacts;
Expand Down Expand Up @@ -359,14 +361,14 @@ public String toString()
if ( artifacts != null )
{
int i = 1;
sb.append( "---------\n" );
sb.append( artifacts.size() ).append( '\n' );
sb.append( "---------" ).append( LS );
sb.append( artifacts.size() ).append( LS );
for ( Artifact a : artifacts )
{
sb.append( i ).append( ' ' ).append( a ).append( '\n' );
sb.append( i ).append( ' ' ).append( a ).append( LS );
i++;
}
sb.append( "---------\n" );
sb.append( "---------" );
}

return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ private ExceptionSummary handle( ProjectBuildingResult result )
return null;
}

String message =
"\nThe project " + result.getProjectId() + " (" + result.getPomFile() + ") has "
+ children.size() + " error" + ( children.size() == 1 ? "" : "s" );
String message = System.lineSeparator()
+ "The project " + result.getProjectId() + " (" + result.getPomFile() + ") has "
+ children.size() + " error" + ( children.size() == 1 ? "" : "s" );

return new ExceptionSummary( null, message, null, children );
}
Expand Down Expand Up @@ -290,7 +290,7 @@ private String getMessage( String message, Throwable exception )
}
else if ( !exceptionMessage.contains( longMessage ) )
{
exceptionMessage = join( exceptionMessage, '\n' + longMessage );
exceptionMessage = join( exceptionMessage, System.lineSeparator() + longMessage );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class PluginParameterException
extends PluginConfigurationException
{

private static final String LS = System.lineSeparator();

private final List<Parameter> parameters;

private final MojoDescriptor mojo;
Expand Down Expand Up @@ -105,50 +107,53 @@ private static void decomposeParameterIntoUserInstructions( MojoDescriptor mojo,

messageBuffer.append( "Inside the definition for plugin \'" );
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( '>' );
if ( isArray || isCollection )
{
messageBuffer.append( '\n' );
messageBuffer.append( LS );
messageBuffer.append( " <item>" );
}
else if ( isProperties )
{
messageBuffer.append( '\n' );
messageBuffer.append( " <property>\n" );
messageBuffer.append( " <name>KEY</name>\n" );
messageBuffer.append( LS );
messageBuffer.append( " <property>" ).append( LS );
messageBuffer.append( " <name>KEY</name>" ).append( LS );
messageBuffer.append( " <value>" );
}
else if ( isMap )
{
messageBuffer.append( '\n' );
messageBuffer.append( LS );
messageBuffer.append( " <KEY>" );
}
messageBuffer.append( "VALUE" );
if ( isArray || isCollection )
{
messageBuffer.append( "</item>\n" );
messageBuffer.append( "</item>" ).append( LS );
messageBuffer.append( " " );
}
else if ( isProperties )
{
messageBuffer.append( "</value>\n" );
messageBuffer.append( " </property>\n" );
messageBuffer.append( "</value>" ).append( LS );
messageBuffer.append( " </property>" ).append( LS );
messageBuffer.append( " " );
}
else if ( isMap )
{
messageBuffer.append( "</KEY>\n" );
messageBuffer.append( "</KEY>" ).append( LS );
messageBuffer.append( " " );
}
messageBuffer.append( "</" ).append( param.getName() ).append( ">\n" );
messageBuffer.append( "</" ).append( param.getName() ).append( ">" ).append( LS );
messageBuffer.append( "</configuration>" );

String alias = param.getAlias();
if ( StringUtils.isNotEmpty( alias ) && !alias.equals( param.getName() ) )
{
messageBuffer.append( "\n\n-OR-\n\n<configuration>\n ...\n <" ).append( alias ).append(
">VALUE</" ).append( alias ).append( ">\n</configuration>\n" );
messageBuffer.append( LS ).append( LS ).append( "-OR-" ).append( LS ).append( LS );
messageBuffer.append( "<configuration>" ).append( LS ).append( " ..." ).append( LS );
messageBuffer.append( " <" ).append( alias ).append(
">VALUE</" ).append( alias ).append( ">" ).append( LS ).append( "</configuration>" ).append( LS );
}
}

Expand All @@ -160,7 +165,7 @@ else if ( isMap )
{
if ( param.isEditable() )
{
messageBuffer.append( "\n\n-OR-\n\n" );
messageBuffer.append( LS ).append( LS ).append( "-OR-" ).append( LS ).append( LS );
}

//addParameterUsageInfo( expression, messageBuffer );
Expand All @@ -176,18 +181,18 @@ public String buildDiagnosticMessage()

messageBuffer.append( "One or more required plugin parameters are invalid/missing for \'" )
.append( mojo.getPluginDescriptor().getGoalPrefix() ).append( ':' ).append( mojo.getGoal() )
.append( "\'\n" );
.append( "\'" ).append( LS );

int idx = 0;
for ( Iterator<Parameter> it = params.iterator(); it.hasNext(); idx++ )
{
Parameter param = it.next();

messageBuffer.append( "\n[" ).append( idx ).append( "] " );
messageBuffer.append( LS ).append( "[" ).append( idx ).append( "] " );

decomposeParameterIntoUserInstructions( mojo, param, messageBuffer );

messageBuffer.append( '\n' );
messageBuffer.append( LS );
}

return messageBuffer.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public void setArtifactHandler( ArtifactHandler handler )
/** {@inheritDoc} */
public String toString()
{
return "active project artifact:\n\tartifact = " + artifact + ";\n\tproject: " + project;
return "active project artifact[artifact: " + artifact + ", project: " + project + "]";
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,23 +688,23 @@ else if ( isNonTransferrablePom( e ) )
}

String message =
"\n This artifact has been relocated to " + artifact.getGroupId() + ":"
+ artifact.getArtifactId() + ":" + artifact.getVersion() + ".\n";
" this artifact has been relocated to " + artifact.getGroupId() + ":"
+ artifact.getArtifactId() + ":" + artifact.getVersion() + ".";

if ( relocation.getMessage() != null )
{
message += " " + relocation.getMessage() + "\n";
message += " " + relocation.getMessage();
}

if ( artifact.getDependencyTrail() != null && artifact.getDependencyTrail().size() == 1 )
{
logger.warn( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" );
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message );
}
else
{
logger.debug( "While downloading " + pomArtifact.getGroupId() + ":"
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" );
+ pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message );
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
public abstract class AbstractArtifactMetadata
implements ArtifactMetadata
{
private static final String LS = System.lineSeparator();

protected Artifact artifact;

protected AbstractArtifactMetadata( Artifact artifact )
Expand All @@ -55,10 +57,10 @@ public String extendedToString()
{
StringBuilder buffer = new StringBuilder( 256 );

buffer.append( "\nArtifact Metadata\n--------------------------" );
buffer.append( "\nGroupId: " ).append( getGroupId() );
buffer.append( "\nArtifactId: " ).append( getArtifactId() );
buffer.append( "\nMetadata Type: " ).append( getClass().getName() );
buffer.append( LS ).append( "Artifact Metadata" ).append( LS ).append( "--------------------------" );
buffer.append( LS ).append( "GroupId: " ).append( getGroupId() );
buffer.append( LS ).append( "ArtifactId: " ).append( getArtifactId() );
buffer.append( LS ).append( "Metadata Type: " ).append( getClass().getName() );

return buffer.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public SettingsConfigurationException( String message, Throwable cause )

public SettingsConfigurationException( String message, Throwable cause, int lineNumber, int columnNumber )
{
super( message + ( lineNumber > 0 ? "\n Line: " + lineNumber : "" )
+ ( columnNumber > 0 ? "\n Column: " + columnNumber : "" ), cause );
super( message + ( lineNumber > 0 ? System.lineSeparator() + " Line: " + lineNumber : "" )
+ ( columnNumber > 0 ? System.lineSeparator() + " Column: " + columnNumber : "" ), cause );
this.lineNumber = lineNumber;
this.columnNumber = columnNumber;
}
Expand Down
Loading