You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2013/08/27 20:25:11 UTC
svn commit: r1517906 [8/24] - in /maven/plugins/trunk:
maven-acr-plugin/src/main/java/org/apache/maven/plugin/acr/
maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/
maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/
maven-antru...
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/AbstractCheckstyleReport.java Tue Aug 27 18:25:03 2013
@@ -165,7 +165,7 @@ public abstract class AbstractCheckstyle
/**
* When using custom treeWalkers, specify their names here so the checks inside the treeWalker end up the the rule-summary
- *
+ *
* @since 2.11
*/
@Parameter
@@ -197,49 +197,37 @@ public abstract class AbstractCheckstyle
protected ByteArrayOutputStream stringOutputStream;
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getName( Locale locale )
{
return getBundle( locale ).getString( "report.checkstyle.name" );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getDescription( Locale locale )
{
return getBundle( locale ).getString( "report.checkstyle.description" );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected String getOutputDirectory()
{
return outputDirectory.getAbsolutePath();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected MavenProject getProject()
{
return project;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected Renderer getSiteRenderer()
{
return siteRenderer;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void executeReport( Locale locale )
throws MavenReportException
{
@@ -296,7 +284,7 @@ public abstract class AbstractCheckstyle
* @throws MavenReportException If something goes wrong during creation.
*/
protected abstract CheckstyleExecutorRequest createRequest()
- throws MavenReportException;
+ throws MavenReportException;
/**
* Creates and returns the report generation listener.
@@ -326,8 +314,8 @@ public abstract class AbstractCheckstyle
else
{
// TODO: failure if not a report
- throw new MavenReportException(
- "Invalid output file format: (" + outputFileFormat + "). Must be 'plain' or 'xml'." );
+ throw new MavenReportException( "Invalid output file format: (" + outputFileFormat
+ + "). Must be 'plain' or 'xml'." );
}
}
@@ -401,8 +389,8 @@ public abstract class AbstractCheckstyle
{
String copyright;
int currentYear = Calendar.getInstance().get( Calendar.YEAR );
- if ( StringUtils.isNotEmpty( project.getInceptionYear() ) && !String.valueOf( currentYear ).equals(
- project.getInceptionYear() ) )
+ if ( StringUtils.isNotEmpty( project.getInceptionYear() )
+ && !String.valueOf( currentYear ).equals( project.getInceptionYear() ) )
{
copyright = project.getInceptionYear() + " - " + currentYear;
}
@@ -446,12 +434,10 @@ public abstract class AbstractCheckstyle
else
{
// Not yet generated - check if the report is on its way
- for ( ReportPlugin report : (Iterable<ReportPlugin>) getProject().getReportPlugins() )
- {
+ for (ReportPlugin report : (Iterable<ReportPlugin>) getProject().getReportPlugins()) {
String artifactId = report.getArtifactId();
- if ( "maven-jxr-plugin".equals( artifactId ) || "jxr-maven-plugin".equals( artifactId ) )
- {
- generator.setXrefLocation( relativePath );
+ if ("maven-jxr-plugin".equals(artifactId) || "jxr-maven-plugin".equals(artifactId)) {
+ generator.setXrefLocation(relativePath);
}
}
}
@@ -473,9 +459,7 @@ public abstract class AbstractCheckstyle
return ResourceBundle.getBundle( "checkstyle-report", locale, AbstractCheckstyleReport.class.getClassLoader() );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void setReportOutputDirectory( File reportOutputDirectory )
{
super.setReportOutputDirectory( reportOutputDirectory );
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Tue Aug 27 18:25:03 2013
@@ -64,7 +64,7 @@ public class CheckstyleReport
/**
* Specifies the names filter of the source files to be used for Checkstyle.
- * <p/>
+ *
* <strong>Note:</strong> default value is {@code **\/*.java}.
*/
@Parameter( property = "checkstyle.includes", defaultValue = JAVA_FILES, required = true )
@@ -325,17 +325,13 @@ public class CheckstyleReport
@Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
private String encoding;
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected MavenProject getProject()
{
return project;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void executeReport( Locale locale )
throws MavenReportException
{
@@ -347,32 +343,28 @@ public class CheckstyleReport
* {@inheritDoc}
*/
protected CheckstyleExecutorRequest createRequest()
- throws MavenReportException
+ throws MavenReportException
{
CheckstyleExecutorRequest request = new CheckstyleExecutorRequest();
- request.setConsoleListener( getConsoleListener() ).setConsoleOutput( consoleOutput ).setExcludes(
- excludes ).setFailsOnError( failsOnError ).setIncludes( includes ).setIncludeTestSourceDirectory(
- includeTestSourceDirectory ).setListener( getListener() ).setLog( getLog() ).setProject(
- project ).setSourceDirectory( sourceDirectory ).setResources( resources ).setStringOutputStream(
- stringOutputStream ).setSuppressionsLocation( suppressionsLocation ).setTestSourceDirectory(
- testSourceDirectory ).setConfigLocation( configLocation ).setPropertyExpansion(
- propertyExpansion ).setHeaderLocation( headerLocation ).setCacheFile(
- cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression ).setEncoding(
- encoding ).setPropertiesLocation( propertiesLocation );
+ request.setConsoleListener( getConsoleListener() ).setConsoleOutput( consoleOutput )
+ .setExcludes( excludes ).setFailsOnError( failsOnError ).setIncludes( includes )
+ .setIncludeTestSourceDirectory( includeTestSourceDirectory ).setListener( getListener() )
+ .setLog( getLog() ).setProject( project ).setSourceDirectory( sourceDirectory ).setResources( resources )
+ .setStringOutputStream( stringOutputStream ).setSuppressionsLocation( suppressionsLocation )
+ .setTestSourceDirectory( testSourceDirectory ).setConfigLocation( configLocation )
+ .setPropertyExpansion( propertyExpansion ).setHeaderLocation( headerLocation )
+ .setCacheFile( cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression )
+ .setEncoding( encoding ).setPropertiesLocation( propertiesLocation );
return request;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getOutputName()
{
return "checkstyle";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public boolean canGenerateReport()
{
// TODO: would be good to scan the files here
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java Tue Aug 27 18:25:03 2013
@@ -69,7 +69,7 @@ public class CheckstyleReportGenerator
private SiteTool siteTool;
private String xrefLocation;
-
+
private List<String> treeWalkerNames = Collections.singletonList( "TreeWalker" );
public CheckstyleReportGenerator( Sink sink, ResourceBundle bundle, File basedir, SiteTool siteTool )
@@ -238,10 +238,10 @@ public class CheckstyleReportGenerator
* current configuration. If the attribute is still not found, the
* specified default value will be returned.
*
- * @param config The current Checkstyle configuration
+ * @param config The current Checkstyle configuration
* @param parentConfigurations The configurations for the parents of the current configuration
- * @param attributeName The name of the attribute
- * @param defaultValue The default value to use if the attribute cannot be found in any configuration
+ * @param attributeName The name of the attribute
+ * @param defaultValue The default value to use if the attribute cannot be found in any configuration
* @return The value of the specified attribute
*/
private String getConfigAttribute( Configuration config, List<Configuration> parentConfigurations,
@@ -326,9 +326,9 @@ public class CheckstyleReportGenerator
/**
* Create a summary for each Checkstyle rule.
*
- * @param configuration The Checkstyle configuration
+ * @param configuration The Checkstyle configuration
* @param parentConfigurations A List of configurations for the chain of parents to the current configuration
- * @param results The results to summarize
+ * @param results The results to summarize
*/
private void doRuleChildren( Configuration configuration, List<Configuration> parentConfigurations,
CheckstyleResults results )
@@ -361,18 +361,14 @@ public class CheckstyleReportGenerator
}
Configuration configChildren[] = configuration.getChildren();
- for ( Configuration aConfigChildren : configChildren )
- {
+ for (Configuration aConfigChildren : configChildren) {
String ruleName = aConfigChildren.getName();
- if ( treeWalkerNames.contains( ruleName ) )
- {
+ if (treeWalkerNames.contains(ruleName)) {
// special sub-case
- doRuleChildren( aConfigChildren, parentConfigurations, results );
- }
- else
- {
- doRuleRow( aConfigChildren, parentConfigurations, ruleName, results );
+ doRuleChildren(aConfigChildren, parentConfigurations, results);
+ } else {
+ doRuleRow(aConfigChildren, parentConfigurations, ruleName, results);
}
}
}
@@ -380,10 +376,10 @@ public class CheckstyleReportGenerator
/**
* Create a summary for one Checkstyle rule.
*
- * @param checkerConfig Configuration for the Checkstyle rule
+ * @param checkerConfig Configuration for the Checkstyle rule
* @param parentConfigurations Configurations for the parents of this rule
- * @param ruleName The name of the rule, for example "JavadocMethod"
- * @param results The results to summarize
+ * @param ruleName The name of the rule, for example "JavadocMethod"
+ * @param results The results to summarize
*/
private void doRuleRow( Configuration checkerConfig, List<Configuration> parentConfigurations, String ruleName,
CheckstyleResults results )
@@ -462,7 +458,8 @@ public class CheckstyleReportGenerator
String fixedmessage = getConfigAttribute( checkerConfig, null, "message", null );
// Grab the severity from the rule configuration, use null as default value
String configSeverity = getConfigAttribute( checkerConfig, null, "severity", null );
- sink.text( countRuleViolation( results.getFiles().values(), ruleName, fixedmessage, configSeverity ) );
+ sink.text( countRuleViolation( results.getFiles().values(), ruleName, fixedmessage,
+ configSeverity ) );
sink.tableCell_();
sink.tableCell();
@@ -510,9 +507,9 @@ public class CheckstyleReportGenerator
/**
* Count the number of violations for the given rule.
*
- * @param files A collection over the set of files that has violations
+ * @param files A collection over the set of files that has violations
* @param ruleName The name of the rule
- * @param message A message that, if it's not null, will be matched to the message from the violation
+ * @param message A message that, if it's not null, will be matched to the message from the violation
* @param severity A severity that, if it's not null, will be matched to the severity from the violation
* @return The number of rule violations
*/
@@ -526,8 +523,9 @@ public class CheckstyleReportGenerator
for ( AuditEvent event : errors )
{
String eventSrcName = event.getSourceName();
- if ( eventSrcName != null && ( eventSrcName.endsWith( ruleName ) || eventSrcName.endsWith(
- ruleName + "Check" ) ) )
+ if ( eventSrcName != null
+ && ( eventSrcName.endsWith( ruleName )
+ || eventSrcName.endsWith( ruleName + "Check" ) ) )
{
// check message too, for those that have a specific one.
// like GenericIllegalRegexp and Regexp
@@ -537,8 +535,8 @@ public class CheckstyleReportGenerator
// Read MessageFormat Javadoc about single quote:
// http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
String msgWithoutSingleQuote = StringUtils.replace( message, "'", "" );
- if ( message.equals( event.getMessage() ) || msgWithoutSingleQuote.equals(
- event.getMessage() ) )
+ if ( message.equals( event.getMessage() )
+ || msgWithoutSingleQuote.equals( event.getMessage() ) )
{
count++;
}
@@ -776,8 +774,9 @@ public class CheckstyleReportGenerator
sink.tableCell();
if ( getXrefLocation() != null )
{
- sink.link(
- getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html" ) + "#" + event.getLine() );
+ sink
+ .link(
+ getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html" ) + "#" + event.getLine() );
}
sink.text( String.valueOf( event.getLine() ) );
if ( getXrefLocation() != null )
@@ -859,13 +858,13 @@ public class CheckstyleReportGenerator
{
this.checkstyleConfig = config;
}
-
-
+
+
public void setTreeWalkerNames( List<String> treeWalkerNames )
{
this.treeWalkerNames = treeWalkerNames;
}
-
+
public List<String> getTreeWalkerNames()
{
return treeWalkerNames;
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java Tue Aug 27 18:25:03 2013
@@ -308,7 +308,7 @@ public class CheckstyleViolationCheckMoj
/**
* Specifies the names filter of the source files to be used for Checkstyle.
- * <p/>
+ *
* <strong>Note:</strong> default value is {@code **\/*.java}.
*/
@Parameter( property = "checkstyle.includes", defaultValue = JAVA_FILES, required = true )
@@ -346,9 +346,7 @@ public class CheckstyleViolationCheckMoj
private ByteArrayOutputStream stringOutputStream;
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public void execute()
throws MojoExecutionException, MojoFailureException
{
@@ -364,16 +362,15 @@ public class CheckstyleViolationCheckMoj
try
{
CheckstyleExecutorRequest request = new CheckstyleExecutorRequest();
- request.setConsoleListener( getConsoleListener() ).setConsoleOutput( consoleOutput ).setExcludes(
- excludes ).setFailsOnError( failsOnError ).setIncludes(
- includes ).setIncludeTestSourceDirectory( includeTestSourceDirectory ).setListener(
- getListener() ).setLog( getLog() ).setProject( project ).setSourceDirectory(
- sourceDirectory ).setResources( resources ).setStringOutputStream(
- stringOutputStream ).setSuppressionsLocation( suppressionsLocation ).setTestSourceDirectory(
- testSourceDirectory ).setConfigLocation( configLocation ).setPropertyExpansion(
- propertyExpansion ).setHeaderLocation( headerLocation ).setCacheFile(
- cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression ).setEncoding(
- encoding ).setPropertiesLocation( propertiesLocation );
+ request.setConsoleListener( getConsoleListener() ).setConsoleOutput( consoleOutput )
+ .setExcludes( excludes ).setFailsOnError( failsOnError ).setIncludes( includes )
+ .setIncludeTestSourceDirectory( includeTestSourceDirectory ).setListener( getListener() )
+ .setLog( getLog() ).setProject( project ).setSourceDirectory( sourceDirectory ).setResources( resources )
+ .setStringOutputStream( stringOutputStream ).setSuppressionsLocation( suppressionsLocation )
+ .setTestSourceDirectory( testSourceDirectory ).setConfigLocation( configLocation )
+ .setPropertyExpansion( propertyExpansion ).setHeaderLocation( headerLocation )
+ .setCacheFile( cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression )
+ .setEncoding( encoding ).setPropertiesLocation( propertiesLocation );
checkstyleExecutor.executeCheckstyle( request );
@@ -395,14 +392,15 @@ public class CheckstyleViolationCheckMoj
}
if ( !"xml".equals( outputFileFormat ) )
{
- throw new MojoExecutionException(
- "Output format is '" + outputFileFormat + "', checkstyle:check requires format to be 'xml'." );
+ throw new MojoExecutionException( "Output format is '" + outputFileFormat
+ + "', checkstyle:check requires format to be 'xml'." );
}
if ( !outputFile.exists() )
{
getLog().info(
- "Unable to perform checkstyle:check, " + "unable to find checkstyle:checkstyle outputFile." );
+ "Unable to perform checkstyle:check, "
+ + "unable to find checkstyle:checkstyle outputFile." );
return;
}
@@ -418,9 +416,8 @@ public class CheckstyleViolationCheckMoj
{
if ( failOnViolation )
{
- String msg =
- "You have " + violations + " Checkstyle violation" + ( ( violations > 1 ) ? "s" : "" )
- + ".";
+ String msg = "You have " + violations + " Checkstyle violation"
+ + ( ( violations > 1 ) ? "s" : "" ) + ".";
if ( maxAllowedViolations > 0 )
{
msg += " The maximum number of allowed violations is " + maxAllowedViolations + ".";
@@ -433,13 +430,13 @@ public class CheckstyleViolationCheckMoj
}
catch ( IOException e )
{
- throw new MojoExecutionException(
- "Unable to read Checkstyle results xml: " + outputFile.getAbsolutePath(), e );
+ throw new MojoExecutionException( "Unable to read Checkstyle results xml: "
+ + outputFile.getAbsolutePath(), e );
}
catch ( XmlPullParserException e )
{
- throw new MojoExecutionException(
- "Unable to read Checkstyle results xml: " + outputFile.getAbsolutePath(), e );
+ throw new MojoExecutionException( "Unable to read Checkstyle results xml: "
+ + outputFile.getAbsolutePath(), e );
}
}
}
@@ -459,14 +456,12 @@ public class CheckstyleViolationCheckMoj
file = file.substring( file.lastIndexOf( File.separatorChar ) + 1 );
}
- if ( eventType == XmlPullParser.START_TAG && "error".equals( xpp.getName() ) && isViolation(
- xpp.getAttributeValue( "", "severity" ) ) )
+ if ( eventType == XmlPullParser.START_TAG && "error".equals( xpp.getName() )
+ && isViolation( xpp.getAttributeValue( "", "severity" ) ) )
{
if ( logViolationsToConsole )
{
- getLog().error(
- file + '[' + xpp.getAttributeValue( "", "line" ) + ':' + xpp.getAttributeValue( "", "column" )
- + "] " + xpp.getAttributeValue( "", "message" ) );
+ getLog().error(file + '[' + xpp.getAttributeValue("", "line") + ':' + xpp.getAttributeValue("", "column") + "] " + xpp.getAttributeValue("", "message"));
}
count++;
}
@@ -486,8 +481,8 @@ public class CheckstyleViolationCheckMoj
{
if ( "error".equals( severity ) )
{
- return "error".equals( violationSeverity ) || "warning".equals( violationSeverity ) || "info".equals(
- violationSeverity );
+ return "error".equals( violationSeverity ) || "warning".equals( violationSeverity )
+ || "info".equals( violationSeverity );
}
else if ( "warning".equals( severity ) )
{
@@ -502,7 +497,6 @@ public class CheckstyleViolationCheckMoj
return false;
}
}
-
private DefaultLogger getConsoleListener()
throws MojoExecutionException
{
@@ -566,8 +560,8 @@ public class CheckstyleViolationCheckMoj
}
else
{
- throw new MojoFailureException(
- "Invalid output file format: (" + outputFileFormat + "). Must be 'plain' or 'xml'." );
+ throw new MojoFailureException( "Invalid output file format: (" + outputFileFormat
+ + "). Must be 'plain' or 'xml'." );
}
}
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java Tue Aug 27 18:25:03 2013
@@ -58,8 +58,8 @@ import com.puppycrawl.tools.checkstyle.f
/**
* @author Olivier Lamy
- * @version $Id$
* @since 2.5
+ * @version $Id$
*/
@Component( role = CheckstyleExecutor.class, hint = "default", instantiationStrategy = "per-lookup" )
public class DefaultCheckstyleExecutor
@@ -146,7 +146,8 @@ public class DefaultCheckstyleExecutor
if ( outputDirectoryFile.exists() )
{
URL outputDirectoryUrl = outputDirectoryFile.toURL();
- request.getLog().debug( "Adding the outputDirectory " + outputDirectoryUrl.toString()
+ request.getLog().debug(
+ "Adding the outputDirectory " + outputDirectoryUrl.toString()
+ " to the Checkstyle class path" );
urls.add( outputDirectoryUrl );
}
@@ -158,7 +159,7 @@ public class DefaultCheckstyleExecutor
}
}
- URLClassLoader projectClassLoader = new URLClassLoader( urls.toArray( new URL[urls.size()] ), null );
+ URLClassLoader projectClassLoader = new URLClassLoader(urls.toArray( new URL[urls.size()] ), null );
checker.setClassloader( projectClassLoader );
checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );
@@ -249,8 +250,8 @@ public class DefaultCheckstyleExecutor
if ( resourcesDirectory.exists() && resourcesDirectory.isDirectory() )
{
sinkListener.addSourceDirectory( resourcesDirectory );
- getLogger().debug(
- "Added '" + resourcesDirectory.getAbsolutePath() + "' as a source directory." );
+ getLogger().debug( "Added '" + resourcesDirectory.getAbsolutePath()
+ + "' as a source directory." );
}
}
}
@@ -269,26 +270,26 @@ public class DefaultCheckstyleExecutor
Thread.currentThread().setContextClassLoader( checkstyleClassLoader );
String configFile = getConfigFile( request );
Properties overridingProperties = getOverridingProperties( request );
- Configuration config =
- ConfigurationLoader.loadConfiguration( configFile, new PropertiesExpander( overridingProperties ) );
- String effectiveEncoding = StringUtils.isNotEmpty( request.getEncoding() )
- ? request.getEncoding()
- : System.getProperty( "file.encoding", "UTF-8" );
+ Configuration config = ConfigurationLoader
+ .loadConfiguration( configFile, new PropertiesExpander( overridingProperties ) );
+ String effectiveEncoding = StringUtils.isNotEmpty( request.getEncoding() ) ? request.getEncoding() : System
+ .getProperty( "file.encoding", "UTF-8" );
if ( StringUtils.isEmpty( request.getEncoding() ) )
{
- request.getLog().warn( "File encoding has not been set, using platform encoding " + effectiveEncoding
+ request.getLog().warn(
+ "File encoding has not been set, using platform encoding " + effectiveEncoding
+ ", i.e. build is platform dependent!" );
}
- if ( "Checker".equals( config.getName() ) || "com.puppycrawl.tools.checkstyle.Checker".equals(
- config.getName() ) )
+ if ( "Checker".equals( config.getName() )
+ || "com.puppycrawl.tools.checkstyle.Checker".equals( config.getName() ) )
{
if ( config instanceof DefaultConfiguration )
{
// MCHECKSTYLE-173 Only add the "charset" attribute if it has not been set
try
{
- if ( config.getAttribute( "charset" ) == null )
+ if ( config.getAttribute("charset") == null )
{
( (DefaultConfiguration) config ).addAttribute( "charset", effectiveEncoding );
}
@@ -305,31 +306,22 @@ public class DefaultCheckstyleExecutor
}
}
Configuration[] modules = config.getChildren();
- for ( Configuration module : modules )
- {
- if ( "TreeWalker".equals( module.getName() ) || "com.puppycrawl.tools.checkstyle.TreeWalker".equals(
- module.getName() ) )
- {
- if ( module instanceof DefaultConfiguration )
- {
+ for (Configuration module : modules) {
+ if ("TreeWalker".equals(module.getName())
+ || "com.puppycrawl.tools.checkstyle.TreeWalker".equals(module.getName())) {
+ if (module instanceof DefaultConfiguration) {
//MCHECKSTYLE-132 DefaultConfiguration addAttribute has changed in checkstyle 5.3
- try
- {
- if ( module.getAttribute( "cacheFile" ) == null )
- {
- ( (DefaultConfiguration) module ).addAttribute( "cacheFile", request.getCacheFile() );
+ try {
+ if (module.getAttribute("cacheFile") == null) {
+ ((DefaultConfiguration) module).addAttribute("cacheFile", request.getCacheFile());
}
- }
- catch ( CheckstyleException ex )
- {
+ } catch (CheckstyleException ex) {
//MCHECKSTYLE-159 - checkstyle 5.4 throws an exception instead of return null if "cacheFile"
// doesn't exist
- ( (DefaultConfiguration) module ).addAttribute( "cacheFile", request.getCacheFile() );
+ ((DefaultConfiguration) module).addAttribute("cacheFile", request.getCacheFile());
}
- }
- else
- {
- request.getLog().warn( "Failed to configure cache file on module " + module );
+ } else {
+ request.getLog().warn("Failed to configure cache file on module " + module);
}
}
}
@@ -381,8 +373,8 @@ public class DefaultCheckstyleExecutor
getLogger().debug( "request.getPropertiesLocation() " + request.getPropertiesLocation() );
}
- File propertiesFile =
- locator.getResourceAsFile( request.getPropertiesLocation(), "checkstyle-checker.properties" );
+ File propertiesFile = locator.getResourceAsFile( request.getPropertiesLocation(),
+ "checkstyle-checker.properties" );
FileInputStream properties = new FileInputStream( propertiesFile );
try
@@ -485,14 +477,12 @@ public class DefaultCheckstyleExecutor
}
String[] defaultExcludes = FileUtils.getDefaultExcludes();
- for ( String defaultExclude : defaultExcludes )
- {
- if ( excludesStr.length() > 0 )
- {
- excludesStr.append( "," );
+ for (String defaultExclude : defaultExcludes) {
+ if (excludesStr.length() > 0) {
+ excludesStr.append(",");
}
- excludesStr.append( defaultExclude );
+ excludesStr.append(defaultExclude);
}
File sourceDirectory = request.getSourceDirectory();
@@ -515,7 +505,7 @@ public class DefaultCheckstyleExecutor
getLogger().debug( "Added " + files.size() + " files to process." );
- return files.toArray( new File[files.size()] );
+ return files.toArray(new File[files.size()]);
}
private void addFilesToProcess( CheckstyleExecutorRequest request, StringBuilder excludesStr, File sourceDirectory,
@@ -524,21 +514,22 @@ public class DefaultCheckstyleExecutor
{
if ( sourceDirectory != null && sourceDirectory.exists() )
{
- final List sourceFiles =
- FileUtils.getFiles( sourceDirectory, request.getIncludes(), excludesStr.toString() );
+ final List sourceFiles = FileUtils.getFiles( sourceDirectory,
+ request.getIncludes(),
+ excludesStr.toString() );
files.addAll( sourceFiles );
- getLogger().debug(
- "Added " + sourceFiles.size() + " source files found in '" + sourceDirectory.getAbsolutePath() + "'." );
+ getLogger().debug( "Added " + sourceFiles.size() + " source files found in '"
+ + sourceDirectory.getAbsolutePath() + "'." );
}
if ( request.isIncludeTestSourceDirectory() && ( testSourceDirectory != null )
&& ( testSourceDirectory.exists() ) && ( testSourceDirectory.isDirectory() ) )
{
- final List testSourceFiles =
- FileUtils.getFiles( testSourceDirectory, request.getIncludes(), excludesStr.toString() );
+ final List testSourceFiles = FileUtils.getFiles( testSourceDirectory, request.getIncludes(),
+ excludesStr.toString() );
files.addAll( testSourceFiles );
getLogger().debug( "Added " + testSourceFiles.size() + " test source files found in '"
- + testSourceDirectory.getAbsolutePath() + "'." );
+ + testSourceDirectory.getAbsolutePath() + "'." );
}
// @todo Should we add a check to see if resources should be included or not, similar to request.isIncludeTestSourceDirectory()?
@@ -555,12 +546,12 @@ public class DefaultCheckstyleExecutor
List resourceFiles = FileUtils.getFiles( resourcesDirectory, "**/*.properties", null );
files.addAll( resourceFiles );
getLogger().debug( "Added " + resourceFiles.size() + " resource files found in '"
- + resourcesDirectory.getAbsolutePath() + "'." );
+ + resourcesDirectory.getAbsolutePath() + "'." );
}
else
{
getLogger().debug( "The resources directory '" + resourcesDirectory.getAbsolutePath()
- + "' does not exist or is not a directory." );
+ + "' does not exist or is not a directory." );
}
}
}
@@ -576,8 +567,8 @@ public class DefaultCheckstyleExecutor
{
try
{
- File suppressionsFile =
- locator.resolveLocation( request.getSuppressionsLocation(), "checkstyle-suppressions.xml" );
+ File suppressionsFile = locator.resolveLocation( request.getSuppressionsLocation(),
+ "checkstyle-suppressions.xml" );
if ( suppressionsFile == null )
{
@@ -588,13 +579,13 @@ public class DefaultCheckstyleExecutor
}
catch ( CheckstyleException ce )
{
- throw new CheckstyleExecutorException(
- "failed to load suppressions location: " + request.getSuppressionsLocation(), ce );
+ throw new CheckstyleExecutorException( "failed to load suppressions location: "
+ + request.getSuppressionsLocation(), ce );
}
catch ( IOException e )
{
- throw new CheckstyleExecutorException(
- "Failed to process supressions location: " + request.getSuppressionsLocation(), e );
+ throw new CheckstyleExecutorException( "Failed to process supressions location: "
+ + request.getSuppressionsLocation(), e );
}
}
@@ -623,20 +614,20 @@ public class DefaultCheckstyleExecutor
File configFile = locator.getResourceAsFile( request.getConfigLocation(), "checkstyle-checker.xml" );
if ( configFile == null )
{
- throw new CheckstyleExecutorException(
- "Unable to process config location: " + request.getConfigLocation() );
+ throw new CheckstyleExecutorException( "Unable to process config location: "
+ + request.getConfigLocation() );
}
return configFile.getAbsolutePath();
}
catch ( org.codehaus.plexus.resource.loader.ResourceNotFoundException e )
{
- throw new CheckstyleExecutorException(
- "Unable to find configuration file at location " + request.getConfigLocation(), e );
+ throw new CheckstyleExecutorException( "Unable to find configuration file at location "
+ + request.getConfigLocation(), e );
}
catch ( FileResourceCreationException e )
{
- throw new CheckstyleExecutorException(
- "Unable to process configuration file location " + request.getConfigLocation(), e );
+ throw new CheckstyleExecutorException( "Unable to process configuration file location "
+ + request.getConfigLocation(), e );
}
}
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java Tue Aug 27 18:25:03 2013
@@ -37,9 +37,7 @@ public class CheckstyleReportListenerTes
{
private Map<SeverityLevel, CheckstyleReportListener> listenerMap;
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void setUp()
throws Exception
{
@@ -68,8 +66,7 @@ public class CheckstyleReportListenerTes
AuditEvent event = new AuditEvent( this, "/source/path/file1", null );
fireFileStarted( event );
- LocalizedMessage message =
- new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
+ LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null );
fireAddError( new AuditEvent( this, "/source/path/file1", message ) );
fireFileFinished( event );
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportTest.java Tue Aug 27 18:25:03 2013
@@ -45,9 +45,7 @@ public class CheckstyleReportTest
{
private Locale oldLocale;
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void setUp()
throws Exception
{
@@ -57,9 +55,7 @@ public class CheckstyleReportTest
Locale.setDefault( Locale.ENGLISH );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void tearDown()
throws Exception
{
@@ -150,8 +146,7 @@ public class CheckstyleReportTest
if ( !( e.getCause().getCause().getCause() instanceof DependencyResolutionRequiredException ) )
{
e.printStackTrace();
- fail( "Must throw exception DependencyResolutionRequiredException on errors and not "
- + e.getClass().getName() + ", " + e.getMessage() );
+ fail( "Must throw exception DependencyResolutionRequiredException on errors and not " + e.getClass().getName() + ", " + e.getMessage() );
}
}
}
@@ -189,7 +184,7 @@ public class CheckstyleReportTest
File outputDir = reportMojo.getReportOutputDirectory();
Boolean rss = (Boolean) getVariableValueFromObject( mojo, "enableRSS" );
- if ( rss )
+ if (rss)
{
File rssFile = new File( outputDir, "checkstyle.rss" );
assertTrue( "Test rss file exists", rssFile.exists() );
@@ -215,7 +210,7 @@ public class CheckstyleReportTest
boolean searchHeaderFound =
( htmlString.indexOf( "<h2>" + bundle.getString( "report.checkstyle.rules" ) ) > 0 );
Boolean rules = (Boolean) getVariableValueFromObject( mojo, "enableRulesSummary" );
- if ( rules )
+ if (rules)
{
assertTrue( "Test for Rules Summary", searchHeaderFound );
}
@@ -224,9 +219,10 @@ public class CheckstyleReportTest
assertFalse( "Test for Rules Summary", searchHeaderFound );
}
- searchHeaderFound = ( htmlString.indexOf( "<h2>" + bundle.getString( "report.checkstyle.summary" ) ) > 0 );
+ searchHeaderFound =
+ ( htmlString.indexOf( "<h2>" + bundle.getString( "report.checkstyle.summary" ) ) > 0 );
Boolean severity = (Boolean) getVariableValueFromObject( mojo, "enableSeveritySummary" );
- if ( severity )
+ if (severity)
{
assertTrue( "Test for Severity Summary", searchHeaderFound );
}
@@ -235,9 +231,10 @@ public class CheckstyleReportTest
assertFalse( "Test for Severity Summary", searchHeaderFound );
}
- searchHeaderFound = ( htmlString.indexOf( "<h2>" + bundle.getString( "report.checkstyle.files" ) ) > 0 );
+ searchHeaderFound =
+ ( htmlString.indexOf( "<h2>" + bundle.getString( "report.checkstyle.files" ) ) > 0 );
Boolean files = (Boolean) getVariableValueFromObject( mojo, "enableFilesSummary" );
- if ( files )
+ if (files)
{
assertTrue( "Test for Files Summary", searchHeaderFound );
}
@@ -252,10 +249,10 @@ public class CheckstyleReportTest
/**
* Renderer the sink from the report mojo.
*
- * @param mojo not null
+ * @param mojo not null
* @param outputHtml not null
* @throws RendererException if any
- * @throws IOException if any
+ * @throws IOException if any
*/
private void renderer( CheckstyleReport mojo, File outputHtml )
throws RendererException, Exception
@@ -270,9 +267,9 @@ public class CheckstyleReportTest
{
outputHtml.getParentFile().mkdirs();
writer = WriterFactory.newXmlWriter( outputHtml );
-
+
mojo.execute();
-
+
}
finally
{
Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MultiMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MultiMavenProjectStub.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MultiMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/stubs/MultiMavenProjectStub.java Tue Aug 27 18:25:03 2013
@@ -48,35 +48,27 @@ public class MultiMavenProjectStub
return this;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public List<String> getCompileClasspathElements()
throws DependencyResolutionRequiredException
{
return Collections.EMPTY_LIST;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public List<String> getTestClasspathElements()
throws DependencyResolutionRequiredException
{
return Collections.EMPTY_LIST;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public File getBasedir()
{
return new File( PlexusTestCase.getBasedir() );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public List<ReportPlugin> getReportPlugins()
{
ReportPlugin jxrPlugin = new ReportPlugin();
@@ -86,9 +78,7 @@ public class MultiMavenProjectStub
return Collections.singletonList( jxrPlugin );
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Organization getOrganization()
{
Organization organization = new Organization();
@@ -98,17 +88,13 @@ public class MultiMavenProjectStub
return organization;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public String getInceptionYear()
{
return "2006";
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public Build getBuild()
{
Build build = new Build();
@@ -118,9 +104,7 @@ public class MultiMavenProjectStub
return build;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
public File getFile()
{
File file = new File( getBasedir(), "pom.xml" );
Modified: maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-absolute-paths/child-a/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-absolute-paths/child-a/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-absolute-paths/child-a/pom.xml (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-absolute-paths/child-a/pom.xml Tue Aug 27 18:25:03 2013
@@ -30,7 +30,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>child-a</artifactId>
+ <artifactId>child-a</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Child A</name>
Modified: maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-a/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-a/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-a/pom.xml (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-a/pom.xml Tue Aug 27 18:25:03 2013
@@ -30,7 +30,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>child-a</artifactId>
+ <artifactId>child-a</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Child A</name>
Modified: maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-b/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-b/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-b/pom.xml (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/file-sets-relative-paths/child-b/pom.xml Tue Aug 27 18:25:03 2013
@@ -30,7 +30,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>child-b</artifactId>
+ <artifactId>child-b</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Child B</name>
Modified: maven/plugins/trunk/maven-clean-plugin/src/test/java/org/apache/maven/plugin/clean/CleanMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/test/java/org/apache/maven/plugin/clean/CleanMojoTest.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/test/java/org/apache/maven/plugin/clean/CleanMojoTest.java (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/test/java/org/apache/maven/plugin/clean/CleanMojoTest.java Tue Aug 27 18:25:03 2013
@@ -37,18 +37,14 @@ import org.codehaus.plexus.util.FileUtil
public class CleanMojoTest
extends AbstractMojoTestCase
{
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void setUp()
throws Exception
{
super.setUp();
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
protected void tearDown()
throws Exception
{
@@ -67,20 +63,19 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/basic-clean-test" ),
- new File( getBasedir(), "target/test-classes/unit/basic-clean-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/basic-clean-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
mojo.execute();
- assertFalse( "Directory exists",
- checkExists( getBasedir() + "/target/test-classes/unit/" + "basic-clean-test/buildDirectory" ) );
- assertFalse( "Directory exists", checkExists(
- getBasedir() + "/target/test-classes/unit/basic-clean-test/" + "buildOutputDirectory" ) );
- assertFalse( "Directory exists", checkExists(
- getBasedir() + "/target/test-classes/unit/basic-clean-test/" + "buildTestDirectory" ) );
+ assertFalse( "Directory exists", checkExists( getBasedir() + "/target/test-classes/unit/"
+ + "basic-clean-test/buildDirectory" ) );
+ assertFalse( "Directory exists", checkExists( getBasedir() + "/target/test-classes/unit/basic-clean-test/"
+ + "buildOutputDirectory" ) );
+ assertFalse( "Directory exists", checkExists( getBasedir() + "/target/test-classes/unit/basic-clean-test/"
+ + "buildTestDirectory" ) );
}
/**
@@ -95,8 +90,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/nested-clean-test" ),
- new File( getBasedir(), "target/test-classes/unit/nested-clean-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/nested-clean-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -121,8 +115,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/empty-clean-test" ),
- new File( getBasedir(), "target/test-classes/unit/empty-clean-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/empty-clean-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupEmptyMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -130,12 +123,12 @@ public class CleanMojoTest
mojo.execute();
assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/empty-clean-test/testDirectoryStructure" ) );
- assertTrue( checkExists(
- getBasedir() + "/target/test-classes/unit/empty-clean-test/" + "testDirectoryStructure/file.txt" ) );
- assertTrue( checkExists(
- getBasedir() + "/target/test-classes/unit/empty-clean-test/" + "testDirectoryStructure/outputDirectory" ) );
assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/empty-clean-test/"
- + "testDirectoryStructure/outputDirectory/file.txt" ) );
+ + "testDirectoryStructure/file.txt" ) );
+ assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/empty-clean-test/"
+ + "testDirectoryStructure/outputDirectory" ) );
+ assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/empty-clean-test/"
+ + "testDirectoryStructure/outputDirectory/file.txt" ) );
}
/**
@@ -150,8 +143,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/fileset-clean-test" ),
- new File( getBasedir(), "target/test-classes/unit/fileset-clean-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/fileset-clean-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -163,16 +155,15 @@ public class CleanMojoTest
assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/classes" ) );
assertFalse( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/test-classes" ) );
assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/subdir" ) );
- assertFalse(
- checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/classes/file.txt" ) );
+ assertFalse( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/classes/file.txt" ) );
assertTrue( checkEmpty( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/classes" ) );
assertTrue( checkEmpty( getBasedir() + "/target/test-classes/unit/fileset-clean-test/target/subdir" ) );
// fileset 2
- assertTrue(
- checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/" + "buildOutputDirectory" ) );
- assertFalse( checkExists(
- getBasedir() + "/target/test-classes/unit/fileset-clean-test/" + "buildOutputDirectory/file.txt" ) );
+ assertTrue( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/"
+ + "buildOutputDirectory" ) );
+ assertFalse( checkExists( getBasedir() + "/target/test-classes/unit/fileset-clean-test/"
+ + "buildOutputDirectory/file.txt" ) );
}
/**
@@ -187,8 +178,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/invalid-directory-test" ),
- new File( getBasedir(), "target/test-classes/unit/invalid-directory-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/invalid-directory-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -217,8 +207,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/missing-directory-test" ),
- new File( getBasedir(), "target/test-classes/unit/missing-directory-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/missing-directory-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -238,7 +227,7 @@ public class CleanMojoTest
public void testCleanLockedFile()
throws Exception
{
- if ( !System.getProperty( "os.name" ).toLowerCase().contains( "windows" ) )
+ if (!System.getProperty("os.name").toLowerCase().contains("windows"))
{
assertTrue( "Ignored this test on none Windows based systems", true );
return;
@@ -248,8 +237,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/locked-file-test" ),
- new File( getBasedir(), "target/test-classes/unit/locked-file-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/locked-file-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
assertNotNull( mojo );
@@ -294,7 +282,7 @@ public class CleanMojoTest
public void testCleanLockedFileWithNoError()
throws Exception
{
- if ( !System.getProperty( "os.name" ).toLowerCase().contains( "windows" ) )
+ if (!System.getProperty("os.name").toLowerCase().contains("windows"))
{
assertTrue( "Ignored this test on none Windows based systems", true );
return;
@@ -304,8 +292,7 @@ public class CleanMojoTest
// safety
FileUtils.copyDirectory( new File( getBasedir(), "src/test/resources/unit/locked-file-test" ),
- new File( getBasedir(), "target/test-classes/unit/locked-file-test" ), null,
- "**/.svn,**/.svn/**" );
+ new File( getBasedir(), "target/test-classes/unit/locked-file-test" ), null, "**/.svn,**/.svn/**" );
CleanMojo mojo = (CleanMojo) lookupMojo( "clean", pluginPom );
setVariableValueToObject( mojo, "failOnError", Boolean.FALSE );
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-1/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-1/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-1/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,14 +1,13 @@
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler-170</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>mcompiler-170-1</artifactId>
+ <artifactId>mcompiler-170-1</artifactId>
<version>1.0-SNAPSHOT</version>
<name>mcompiler-170-1</name>
<url>http://maven.apache.org</url>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-2/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-2/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-2/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-2/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,14 +1,13 @@
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler-170</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>mcompiler-170-2</artifactId>
+ <artifactId>mcompiler-170-2</artifactId>
<version>1.0-SNAPSHOT</version>
<name>mcompiler-170-1</name>
<url>http://maven.apache.org</url>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-3/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-3/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-3/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-3/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,14 +1,13 @@
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler-170</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>mcompiler-170-3</artifactId>
+ <artifactId>mcompiler-170-3</artifactId>
<version>1.0-SNAPSHOT</version>
<name>mcompiler-170-1</name>
<url>http://maven.apache.org</url>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-4/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-4/pom.xml?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-4/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-170/mcompiler-170-4/pom.xml Tue Aug 27 18:25:03 2013
@@ -1,14 +1,13 @@
<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler-170</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>mcompiler-170-4</artifactId>
+ <artifactId>mcompiler-170-4</artifactId>
<version>1.0-SNAPSHOT</version>
<name>mcompiler-170-1</name>
<url>http://maven.apache.org</url>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java Tue Aug 27 18:25:03 2013
@@ -81,49 +81,49 @@ public abstract class AbstractCompilerMo
*
* @since 2.0.2
*/
- @Parameter( property = "maven.compiler.failOnError", defaultValue = "true" )
+ @Parameter(property = "maven.compiler.failOnError", defaultValue = "true")
private boolean failOnError = true;
/**
* Set to <code>true</code> to include debugging information in the compiled class files.
*/
- @Parameter( property = "maven.compiler.debug", defaultValue = "true" )
+ @Parameter(property = "maven.compiler.debug", defaultValue = "true")
private boolean debug = true;
/**
* Set to <code>true</code> to show messages about what the compiler is doing.
*/
- @Parameter( property = "maven.compiler.verbose", defaultValue = "false" )
+ @Parameter(property = "maven.compiler.verbose", defaultValue = "false")
private boolean verbose;
/**
* Sets whether to show source locations where deprecated APIs are used.
*/
- @Parameter( property = "maven.compiler.showDeprecation", defaultValue = "false" )
+ @Parameter(property = "maven.compiler.showDeprecation", defaultValue = "false")
private boolean showDeprecation;
/**
* Set to <code>true</code> to optimize the compiled code using the compiler's optimization methods.
*/
- @Parameter( property = "maven.compiler.optimize", defaultValue = "false" )
+ @Parameter(property = "maven.compiler.optimize", defaultValue = "false")
private boolean optimize;
/**
* Set to <code>true</code> to show compilation warnings.
*/
- @Parameter( property = "maven.compiler.showWarnings", defaultValue = "false" )
+ @Parameter(property = "maven.compiler.showWarnings", defaultValue = "false")
private boolean showWarnings;
/**
* The -source argument for the Java compiler.
*/
- @Parameter( property = "maven.compiler.source", defaultValue = "1.5" )
+ @Parameter(property = "maven.compiler.source", defaultValue = "1.5")
protected String source;
/**
* The -target argument for the Java compiler.
*/
- @Parameter( property = "maven.compiler.target", defaultValue = "1.5" )
+ @Parameter(property = "maven.compiler.target", defaultValue = "1.5")
protected String target;
/**
@@ -131,34 +131,34 @@ public abstract class AbstractCompilerMo
*
* @since 2.1
*/
- @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
+ @Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}")
private String encoding;
/**
* Sets the granularity in milliseconds of the last modification
* date for testing whether a source needs recompilation.
*/
- @Parameter( property = "lastModGranularityMs", defaultValue = "0" )
+ @Parameter(property = "lastModGranularityMs", defaultValue = "0")
private int staleMillis;
/**
* The compiler id of the compiler to use. See this
* <a href="non-javac-compilers.html">guide</a> for more information.
*/
- @Parameter( property = "maven.compiler.compilerId", defaultValue = "javac" )
+ @Parameter(property = "maven.compiler.compilerId", defaultValue = "javac")
private String compilerId;
/**
* Version of the compiler to use, ex. "1.3", "1.5", if {@link #fork} is set to <code>true</code>.
*/
- @Parameter( property = "maven.compiler.compilerVersion" )
+ @Parameter(property = "maven.compiler.compilerVersion")
private String compilerVersion;
/**
* Allows running the compiler in a separate process.
* If <code>false</code> it uses the built in compiler, while if <code>true</code> it will use an executable.
*/
- @Parameter( property = "maven.compiler.fork", defaultValue = "false" )
+ @Parameter(property = "maven.compiler.fork", defaultValue = "false")
private boolean fork;
/**
@@ -167,7 +167,7 @@ public abstract class AbstractCompilerMo
*
* @since 2.0.1
*/
- @Parameter( property = "maven.compiler.meminitial" )
+ @Parameter(property = "maven.compiler.meminitial")
private String meminitial;
/**
@@ -176,13 +176,13 @@ public abstract class AbstractCompilerMo
*
* @since 2.0.1
*/
- @Parameter( property = "maven.compiler.maxmem" )
+ @Parameter(property = "maven.compiler.maxmem")
private String maxmem;
/**
* Sets the executable of the compiler to use when {@link #fork} is <code>true</code>.
*/
- @Parameter( property = "maven.compiler.executable" )
+ @Parameter(property = "maven.compiler.executable")
private String executable;
/**
@@ -233,14 +233,14 @@ public abstract class AbstractCompilerMo
* </pre>
*
* @since 2.0.1
- * @deprecated use {@link #compilerArgs} instead.
+ * @deprecated use {@link #compilerArgs} instead.
*/
@Parameter
@Deprecated
protected Map<String, String> compilerArguments;
/**
- * <p/>
+ * <p>
* Sets the arguments to be passed to the compiler if {@link #fork} is set to <code>true</code>.
* Example:
* <pre>
@@ -254,7 +254,7 @@ public abstract class AbstractCompilerMo
*/
@Parameter
protected List<String> compilerArgs;
-
+
/**
* <p>
* Sets the unformatted single argument string to be passed to the compiler if {@link #fork} is set to <code>true</code>.
@@ -285,7 +285,7 @@ public abstract class AbstractCompilerMo
*
* @since 2.1
*/
- @Parameter( property = "maven.compiler.debuglevel" )
+ @Parameter(property = "maven.compiler.debuglevel")
private String debuglevel;
/**
@@ -301,13 +301,13 @@ public abstract class AbstractCompilerMo
/**
* The directory to run the compiler from if fork is true.
*/
- @Parameter( defaultValue = "${basedir}", required = true, readonly = true )
+ @Parameter(defaultValue = "${basedir}", required = true, readonly = true)
private File basedir;
/**
* The target directory of the compiler if fork is true.
*/
- @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true )
+ @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true)
private File buildDirectory;
/**
@@ -334,13 +334,13 @@ public abstract class AbstractCompilerMo
*
* @since 2.5
*/
- @Parameter( defaultValue = "${reuseCreated}", property = "maven.compiler.compilerReuseStrategy" )
+ @Parameter(defaultValue = "${reuseCreated}", property = "maven.compiler.compilerReuseStrategy")
private String compilerReuseStrategy = "reuseCreated";
/**
* @since 2.5
*/
- @Parameter( defaultValue = "false", property = "maven.compiler.skipMultiThreadWarning" )
+ @Parameter(defaultValue = "false", property = "maven.compiler.skipMultiThreadWarning")
private boolean skipMultiThreadWarning;
/**
@@ -349,13 +349,13 @@ public abstract class AbstractCompilerMo
*
* @since 3.0
*/
- @Parameter( defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse" )
+ @Parameter(defaultValue = "false", property = "maven.compiler.forceJavacCompilerUse")
private boolean forceJavacCompilerUse;
/**
* @since 3.0 needed for storing the status for the incremental build support.
*/
- @Parameter( property = "mojoExecution" )
+ @Parameter(property = "mojoExecution")
private MojoExecution mojoExecution;
/**
@@ -377,10 +377,9 @@ public abstract class AbstractCompilerMo
/**
* to enable/disable incrementation compilation feature
- *
* @since 3.1
*/
- @Parameter( defaultValue = "true", property = "maven.compiler.useIncrementalCompilation" )
+ @Parameter(defaultValue = "true", property = "maven.compiler.useIncrementalCompilation")
private boolean useIncrementalCompilation = true;
protected abstract SourceInclusionScanner getSourceInclusionScanner( int staleMillis );
@@ -481,13 +480,11 @@ public abstract class AbstractCompilerMo
if ( debug && StringUtils.isNotEmpty( debuglevel ) )
{
String[] split = StringUtils.split( debuglevel, "," );
- for ( String aSplit : split )
- {
- if ( !( aSplit.equalsIgnoreCase( "none" ) || aSplit.equalsIgnoreCase( "lines" )
- || aSplit.equalsIgnoreCase( "vars" ) || aSplit.equalsIgnoreCase( "source" ) ) )
- {
- throw new IllegalArgumentException( "The specified debug level: '" + aSplit + "' is unsupported. "
- + "Legal values are 'none', 'lines', 'vars', and 'source'." );
+ for (String aSplit : split) {
+ if (!(aSplit.equalsIgnoreCase("none") || aSplit.equalsIgnoreCase("lines")
+ || aSplit.equalsIgnoreCase("vars") || aSplit.equalsIgnoreCase("source"))) {
+ throw new IllegalArgumentException("The specified debug level: '" + aSplit + "' is unsupported. "
+ + "Legal values are 'none', 'lines', 'vars', and 'source'.");
}
}
compilerConfiguration.setDebugLevel( debuglevel );
@@ -515,8 +512,7 @@ public abstract class AbstractCompilerMo
String effectiveCompilerArgument = getCompilerArgument();
- if ( ( effectiveCompilerArguments != null ) || ( effectiveCompilerArgument != null ) || ( compilerArgs
- != null ) )
+ if ( ( effectiveCompilerArguments != null ) || ( effectiveCompilerArgument != null ) || ( compilerArgs != null ) )
{
LinkedHashMap<String, String> cplrArgsCopy = new LinkedHashMap<String, String>();
if ( effectiveCompilerArguments != null )
@@ -608,10 +604,7 @@ public abstract class AbstractCompilerMo
{
if ( !skipMultiThreadWarning )
{
- getLog().warn(
- "You are in a multi-thread build and compilerReuseStrategy is set to reuseSame. This can cause issues in some environments (os/jdk)! Consider using reuseCreated strategy."
- + System.getProperty( "line.separator" )
- + "If your env is fine with reuseSame, you can skip this warning with the configuration field skipMultiThreadWarning or -Dmaven.compiler.skipMultiThreadWarning=true" );
+ getLog().warn("You are in a multi-thread build and compilerReuseStrategy is set to reuseSame. This can cause issues in some environments (os/jdk)! Consider using reuseCreated strategy." + System.getProperty("line.separator") + "If your env is fine with reuseSame, you can skip this warning with the configuration field skipMultiThreadWarning or -Dmaven.compiler.skipMultiThreadWarning=true");
}
}
compilerConfiguration.setCompilerReuseStrategy( CompilerConfiguration.CompilerReuseStrategy.ReuseSame );
@@ -645,9 +638,8 @@ public abstract class AbstractCompilerMo
incrementalBuildHelperRequest = new IncrementalBuildHelperRequest().inputFiles( sources );
- if ( ( compiler.getCompilerOutputStyle().equals(
- CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES ) && !canUpdateTarget )
- || isDependencyChanged() || isSourceChanged( compilerConfiguration, compiler )
+ if ( ( compiler.getCompilerOutputStyle().equals( CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES )
+ && !canUpdateTarget ) || isDependencyChanged() || isSourceChanged( compilerConfiguration, compiler )
|| incrementalBuildHelper.inputFileTreeChanged( incrementalBuildHelperRequest ) )
{
getLog().info( "Changes detected - recompiling the module!" );
@@ -685,7 +677,7 @@ public abstract class AbstractCompilerMo
String inputFileEnding = compiler.getInputFileEnding( compilerConfiguration );
sources = computeStaleSources( compilerConfiguration, compiler,
- getSourceInclusionScanner( inputFileEnding ) );
+ getSourceInclusionScanner( inputFileEnding ) );
compilerConfiguration.setSourceFiles( sources );
}
@@ -769,6 +761,7 @@ public abstract class AbstractCompilerMo
CompilerResult compilerResult;
+
if ( useIncrementalCompilation )
{
incrementalBuildHelperRequest.outputDirectory( getOutputDirectory() );
Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java Tue Aug 27 18:25:03 2013
@@ -100,7 +100,7 @@ public class CompilerMojo
* Set this to 'true' to bypass compilation of main sources.
* Its use is NOT RECOMMENDED, but quite convenient on occasion.
*/
- @Parameter( property = "maven.main.skip" )
+ @Parameter ( property = "maven.main.skip" )
private boolean skipMain;
protected List<String> getCompileSourceRoots()
Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java Tue Aug 27 18:25:03 2013
@@ -41,8 +41,8 @@ import java.util.Set;
* @version $Id$
* @since 2.0
*/
-@org.apache.maven.plugins.annotations.Mojo( name = "testCompile", defaultPhase = LifecyclePhase.TEST_COMPILE,
- threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
+@org.apache.maven.plugins.annotations.Mojo ( name = "testCompile", defaultPhase = LifecyclePhase.TEST_COMPILE,
+ threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
public class TestCompilerMojo
extends AbstractCompilerMojo
{
@@ -50,25 +50,25 @@ public class TestCompilerMojo
* Set this to 'true' to bypass compilation of test sources.
* Its use is NOT RECOMMENDED, but quite convenient on occasion.
*/
- @Parameter( property = "maven.test.skip" )
+ @Parameter ( property = "maven.test.skip" )
private boolean skip;
/**
* The source directories containing the test-source to be compiled.
*/
- @Parameter( defaultValue = "${project.testCompileSourceRoots}", readonly = true, required = true )
+ @Parameter ( defaultValue = "${project.testCompileSourceRoots}", readonly = true, required = true )
private List<String> compileSourceRoots;
/**
* Project test classpath.
*/
- @Parameter( defaultValue = "${project.testClasspathElements}", required = true, readonly = true )
+ @Parameter ( defaultValue = "${project.testClasspathElements}", required = true, readonly = true )
private List<String> classpathElements;
/**
* The directory where compiled test classes go.
*/
- @Parameter( defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true )
+ @Parameter ( defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true )
private File outputDirectory;
/**
@@ -88,7 +88,7 @@ public class TestCompilerMojo
*
* @since 2.1
*/
- @Parameter( property = "maven.compiler.testSource" )
+ @Parameter ( property = "maven.compiler.testSource" )
private String testSource;
/**
@@ -96,7 +96,7 @@ public class TestCompilerMojo
*
* @since 2.1
*/
- @Parameter( property = "maven.compiler.testTarget" )
+ @Parameter ( property = "maven.compiler.testTarget" )
private String testTarget;
@@ -136,7 +136,7 @@ public class TestCompilerMojo
*
* @since 2.2
*/
- @Parameter( defaultValue = "${project.build.directory}/generated-test-sources/test-annotations" )
+ @Parameter ( defaultValue = "${project.build.directory}/generated-test-sources/test-annotations" )
private File generatedTestSourcesDirectory;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java?rev=1517906&r1=1517905&r2=1517906&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java Tue Aug 27 18:25:03 2013
@@ -195,7 +195,7 @@ public class GetMojo
if ( artifactId == null && artifact == null )
{
throw new MojoFailureException( "You must specify an artifact, "
- + "e.g. -Dartifact=org.apache.maven.plugins:maven-downloader-plugin:1.0" );
+ + "e.g. -Dartifact=org.apache.maven.plugins:maven-downloader-plugin:1.0" );
}
if ( artifact != null )
{
@@ -300,7 +300,7 @@ public class GetMojo
else
{
FileUtils.copyFile( src, dest );
- }
+ }
}
catch ( IOException e )
{
@@ -320,7 +320,7 @@ public class GetMojo
String url = repo;
// if it's an extended repo URL of the form id::layout::url
- if ( repo.contains( "::" ) )
+ if (repo.contains("::"))
{
Matcher matcher = ALT_REPO_SYNTAX_PATTERN.matcher( repo );
if ( !matcher.matches() )
@@ -355,7 +355,7 @@ public class GetMojo
public boolean isSkip()
{
return skip;
- }
+}
public void setSkip( boolean skip )
{