diff --git a/src/it/it-display-dependency-updates-008-displayTerminalWidth/invoker.properties b/src/it/it-display-dependency-updates-008-outputLineWidth/invoker.properties similarity index 69% rename from src/it/it-display-dependency-updates-008-displayTerminalWidth/invoker.properties rename to src/it/it-display-dependency-updates-008-outputLineWidth/invoker.properties index a1534ca8be..3a78145dd3 100644 --- a/src/it/it-display-dependency-updates-008-displayTerminalWidth/invoker.properties +++ b/src/it/it-display-dependency-updates-008-outputLineWidth/invoker.properties @@ -1,2 +1,2 @@ invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates -invoker.mavenOpts=-Dverbose=true -Dversions.outputFile=./dependencyUpdate.txt -DoutputEncoding=UTF-8 -Dversions.displayTerminalWidth=120 \ No newline at end of file +invoker.mavenOpts=-Dverbose=true -Dversions.outputFile=./dependencyUpdate.txt -DoutputEncoding=UTF-8 -Dversions.outputLineWidth=120 \ No newline at end of file diff --git a/src/it/it-display-dependency-updates-008-displayTerminalWidth/pom.xml b/src/it/it-display-dependency-updates-008-outputLineWidth/pom.xml similarity index 100% rename from src/it/it-display-dependency-updates-008-displayTerminalWidth/pom.xml rename to src/it/it-display-dependency-updates-008-outputLineWidth/pom.xml diff --git a/src/it/it-display-dependency-updates-008-displayTerminalWidth/verify.bsh b/src/it/it-display-dependency-updates-008-outputLineWidth/verify.bsh similarity index 100% rename from src/it/it-display-dependency-updates-008-displayTerminalWidth/verify.bsh rename to src/it/it-display-dependency-updates-008-outputLineWidth/verify.bsh diff --git a/src/it/it-display-plugin-updates-012-displayTerminalWidth/invoker.properties b/src/it/it-display-plugin-updates-012-outputLineWidth/invoker.properties similarity index 71% rename from src/it/it-display-plugin-updates-012-displayTerminalWidth/invoker.properties rename to src/it/it-display-plugin-updates-012-outputLineWidth/invoker.properties index a2c0507fe7..af55d25b87 100644 --- a/src/it/it-display-plugin-updates-012-displayTerminalWidth/invoker.properties +++ b/src/it/it-display-plugin-updates-012-outputLineWidth/invoker.properties @@ -1 +1 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates -Dversions.outputFile=./dependencyUpdate.txt -Dversions.displayTerminalWidth=120 +invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates -Dversions.outputFile=./dependencyUpdate.txt -Dversions.outputLineWidth=120 diff --git a/src/it/it-display-plugin-updates-012-displayTerminalWidth/pom.xml b/src/it/it-display-plugin-updates-012-outputLineWidth/pom.xml similarity index 100% rename from src/it/it-display-plugin-updates-012-displayTerminalWidth/pom.xml rename to src/it/it-display-plugin-updates-012-outputLineWidth/pom.xml diff --git a/src/it/it-display-plugin-updates-012-displayTerminalWidth/verify.bsh b/src/it/it-display-plugin-updates-012-outputLineWidth/verify.bsh similarity index 100% rename from src/it/it-display-plugin-updates-012-displayTerminalWidth/verify.bsh rename to src/it/it-display-plugin-updates-012-outputLineWidth/verify.bsh diff --git a/src/it/it-display-property-updates-002-displayTerminalWidth/invoker.properties b/src/it/it-display-property-updates-002-outputLineWidth/invoker.properties similarity index 63% rename from src/it/it-display-property-updates-002-displayTerminalWidth/invoker.properties rename to src/it/it-display-property-updates-002-outputLineWidth/invoker.properties index 21a664fe84..ff42f5409c 100644 --- a/src/it/it-display-property-updates-002-displayTerminalWidth/invoker.properties +++ b/src/it/it-display-property-updates-002-outputLineWidth/invoker.properties @@ -1 +1 @@ -invoker.goals=-DautoLinkItems=true ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates -Dversions.outputFile=./dependencyUpdate.txt -Dversions.displayTerminalWidth=120 +invoker.goals=-DautoLinkItems=true ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates -Dversions.outputFile=./dependencyUpdate.txt -Dversions.outputLineWidth=120 diff --git a/src/it/it-display-property-updates-002-displayTerminalWidth/pom.xml b/src/it/it-display-property-updates-002-outputLineWidth/pom.xml similarity index 100% rename from src/it/it-display-property-updates-002-displayTerminalWidth/pom.xml rename to src/it/it-display-property-updates-002-outputLineWidth/pom.xml diff --git a/src/it/it-display-property-updates-002-displayTerminalWidth/verify.bsh b/src/it/it-display-property-updates-002-outputLineWidth/verify.bsh similarity index 100% rename from src/it/it-display-property-updates-002-displayTerminalWidth/verify.bsh rename to src/it/it-display-property-updates-002-outputLineWidth/verify.bsh diff --git a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDisplayMojo.java b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDisplayMojo.java index b300c5cb6a..3846430a23 100644 --- a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDisplayMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDisplayMojo.java @@ -37,7 +37,7 @@ public abstract class AbstractVersionsDisplayMojo extends AbstractVersionsUpdaterMojo { - private static final int DEFAULT_DISPLAY_TERMINAL_WIDTH = 80; + private static final int DEFAULT_OUTPUT_LINE_WIDTH = 80; /** * If specified then the display output will be sent to the specified file. @@ -64,12 +64,12 @@ public abstract class AbstractVersionsDisplayMojo private String outputEncoding; /** - * Terminal width which should be used to format the padding of the version info list output. + * Line width which should be used to format the padding of the version info list output. * * @since 2.10.0 */ - @Parameter( property = "versions.displayTerminalWidth", defaultValue = AbstractVersionsDisplayMojo.DEFAULT_DISPLAY_TERMINAL_WIDTH + "" ) - private int displayTerminalWidth; + @Parameter( property = "versions.outputLineWidth", defaultValue = AbstractVersionsDisplayMojo.DEFAULT_OUTPUT_LINE_WIDTH + "" ) + private int outputLineWidth; private boolean outputFileError = false; @@ -162,10 +162,10 @@ protected void logLine( boolean error, String line ) } /** - * @return Offset of the configured display terminal width compared to the default with of 80. + * @return Offset of the configured output line width compared to the default with of 80. */ - protected int getDisplayTerminalWidthOffset() { - return this.displayTerminalWidth - DEFAULT_DISPLAY_TERMINAL_WIDTH; + protected int getOutputLineWidthOffset() { + return this.outputLineWidth - DEFAULT_OUTPUT_LINE_WIDTH; } } diff --git a/src/main/java/org/codehaus/mojo/versions/DisplayDependencyUpdatesMojo.java b/src/main/java/org/codehaus/mojo/versions/DisplayDependencyUpdatesMojo.java index a2c7439d8a..34c4c64740 100644 --- a/src/main/java/org/codehaus/mojo/versions/DisplayDependencyUpdatesMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/DisplayDependencyUpdatesMojo.java @@ -436,15 +436,15 @@ private void logUpdates( Map updates, String secti } String right = " " + ( latest == null ? current : current + " -> " + latest ); List t = latest == null ? usingCurrent : withUpdates; - if ( right.length() + left.length() + 3 > INFO_PAD_SIZE + getDisplayTerminalWidthOffset() ) + if ( right.length() + left.length() + 3 > INFO_PAD_SIZE + getOutputLineWidthOffset() ) { t.add( left + "..." ); - t.add( StringUtils.leftPad( right, INFO_PAD_SIZE + getDisplayTerminalWidthOffset() ) ); + t.add( StringUtils.leftPad( right, INFO_PAD_SIZE + getOutputLineWidthOffset() ) ); } else { - t.add( StringUtils.rightPad( left, INFO_PAD_SIZE + getDisplayTerminalWidthOffset() - right.length(), "." ) + right ); + t.add( StringUtils.rightPad( left, INFO_PAD_SIZE + getOutputLineWidthOffset() - right.length(), "." ) + right ); } } diff --git a/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java b/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java index d400d8c046..18804e7f23 100644 --- a/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java @@ -476,12 +476,12 @@ public void execute() { // plugin version configured that require a Maven version higher than spec upgradePlugins.put( upgradePluginKey, - pad( upgradePluginKey, INFO_PAD_SIZE + getDisplayTerminalWidthOffset(), newer ) ); + pad( upgradePluginKey, INFO_PAD_SIZE + getOutputLineWidthOffset(), newer ) ); } else { // plugin that can be upgraded - upgradePlugins.put( upgradePluginKey, pad( upgradePluginKey, INFO_PAD_SIZE + getDisplayTerminalWidthOffset(), + upgradePlugins.put( upgradePluginKey, pad( upgradePluginKey, INFO_PAD_SIZE + getOutputLineWidthOffset(), effectiveVersion, " -> ", newer ) ); } } @@ -551,7 +551,7 @@ public void execute() superPomDrivingMinVersion = true; } - pluginLockdowns.add( pad( compactKey( groupId, artifactId ), WARN_PAD_SIZE + getDisplayTerminalWidthOffset(), + pluginLockdowns.add( pad( compactKey( groupId, artifactId ), WARN_PAD_SIZE + getOutputLineWidthOffset(), superPomDrivingMinVersion ? FROM_SUPER_POM : "", newVersion ) ); } else if ( artifactVersion != null ) @@ -565,7 +565,7 @@ else if ( artifactVersion != null ) if ( version != null && artifactVersion != null && newVersion != null && effectiveVersion != null && new DefaultArtifactVersion( effectiveVersion ).compareTo( new DefaultArtifactVersion( newVersion ) ) < 0 ) { - pluginUpdates.add( pad( compactKey( groupId, artifactId ), INFO_PAD_SIZE + getDisplayTerminalWidthOffset(), + pluginUpdates.add( pad( compactKey( groupId, artifactId ), INFO_PAD_SIZE + getOutputLineWidthOffset(), effectiveVersion, " -> ", newVersion ) ); } } diff --git a/src/main/java/org/codehaus/mojo/versions/DisplayPropertyUpdatesMojo.java b/src/main/java/org/codehaus/mojo/versions/DisplayPropertyUpdatesMojo.java index bb21169a21..2ac1607ea4 100644 --- a/src/main/java/org/codehaus/mojo/versions/DisplayPropertyUpdatesMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/DisplayPropertyUpdatesMojo.java @@ -148,7 +148,7 @@ public void execute() buf.append( property.getName() ); buf.append( "} " ); final String newVersion = winner.toString(); - int padding = INFO_PAD_SIZE - currentVersion.length() - newVersion.length() - 4 + getDisplayTerminalWidthOffset(); + int padding = INFO_PAD_SIZE - currentVersion.length() - newVersion.length() - 4 + getOutputLineWidthOffset(); while ( buf.length() < padding ) { buf.append( '.' ); @@ -165,7 +165,7 @@ public void execute() buf.append( "${" ); buf.append( property.getName() ); buf.append( "} " ); - int padding = INFO_PAD_SIZE - currentVersion.length() + getDisplayTerminalWidthOffset(); + int padding = INFO_PAD_SIZE - currentVersion.length() + getOutputLineWidthOffset(); while ( buf.length() < padding ) { buf.append( '.' );