code: public boolean copyFileToDirectoryIfNecessary( File sourceFile, File targetDirectory )
              throws MojoExecutionException
      {
  
          if ( sourceFile == null )
          {
              throw new IllegalArgumentException( "sourceFile is null" );
          }
  
          File targetFile = new File( targetDirectory, sourceFile.getName() );
  
          boolean shouldCopy = shouldCopyFile( sourceFile, targetFile );
  
          if ( shouldCopy )
          {
              try
              {
                  FileUtils.copyFileToDirectory( sourceFile, targetDirectory );
              }
              catch ( IOException e )
              {
                  throw new MojoExecutionException(
                          "Could not copy file " + sourceFile + " to directory " + targetDirectory, e );
              }
          }
          else
          {
              getLogger().debug(
                      "Source file hasn't changed. Do not overwrite " + targetFile + " with " + sourceFile + "." );
  
          }
  
          return shouldCopy;
      }
docs: {@inheritDoc}