Author: bentmann Date: Thu Sep 4 08:29:53 2008 New Revision: 692102 URL: http://svn.apache.org/viewvc?rev=692102&view=rev Log: [MCLEAN-37] Make verbose mode default to Maven's global debug mode
Modified: maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java Modified: maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java?rev=692102&r1=692101&r2=692102&view=diff ============================================================================== --- maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java (original) +++ maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java Thu Sep 4 08:29:53 2008 @@ -101,12 +101,13 @@ private File reportDirectory; /** - * Sets whether the plugin runs in verbose mode. - * - * @parameter expression="${clean.verbose}" default-value="false" + * Sets whether the plugin runs in verbose mode. As of plugin version 2.3, the default value is derived from Maven's + * global debug flag (compare command line switch <code>-X</code>). + * + * @parameter expression="${clean.verbose}" * @since 2.1 */ - private boolean verbose; + private Boolean verbose; /** * The list of fileSets to delete, in addition to the default directories. @@ -167,7 +168,7 @@ try { - fileSetManager = new FileSetManager( getLog(), verbose ); + fileSetManager = new FileSetManager( getLog(), isVerbose()); removeDirectory( directory ); removeDirectory( outputDirectory ); @@ -188,6 +189,16 @@ } /** + * Indicates whether verbose output is enabled. + * + * @return <code>true</code> if verbose output is enabled, <code>false</code> otherwise. + */ + private boolean isVerbose() + { + return ( verbose != null ) ? verbose.booleanValue() : getLog().isDebugEnabled(); + } + + /** * Deletes additional file-sets specified by the <code>filesets</code> tag. * * @throws MojoExecutionException When a directory failed to get deleted.