code: protected synchronized void executeMojo(File targetDir) throws MojoExecutionException {
  		if (this.generateTargets.contains(targetDir)
  				&& targetDir.isDirectory()) {
  			getLog().debug("Skiping " + targetDir + " because is was already generated"); //$NON-NLS-1$ //$NON-NLS-2$
  			return;
  		}
  
  		this.generateTargets.add(targetDir);
  
  		final File[] sourceDirs;
  		final File mainDirectory = new File(getSourceDirectory(), "main"); //$NON-NLS-1$
  		if (this.sources == null || this.sources.length == 0) {
  			sourceDirs = new File[] {
  				new File(mainDirectory, "java"), //$NON-NLS-1$
  			};
  		} else {
  			sourceDirs = this.sources;
  		}
  
  		clearInternalBuffers();
  
  		for (final File sourceDir : sourceDirs) {
  			Map<File, File> htmlBasedFiles = this.bufferedFiles.get(sourceDir);
  
  			if (htmlBasedFiles == null) {
  				htmlBasedFiles = new TreeMap<>();
  				if (sourceDir.isDirectory()) {
  					// Search for .java files
  					findFiles(sourceDir, new JavaSourceFileFilter(), htmlBasedFiles);
  				}
  
  				this.bufferedFiles.put(sourceDir, htmlBasedFiles);
  			}
  
  			for (final Entry<File, File> entry : htmlBasedFiles.entrySet()) {
  				final String baseFile = removePathPrefix(entry.getValue(), entry.getKey());
  				replaceInFileBuffered(
  						entry.getKey(),
  						new File(targetDir, baseFile),
  						ReplacementType.HTML,
  						sourceDirs,
  						false);
  			}
  		}
  	}
docs: Execute the replacement mojo inside the given target directory.
  
  @param targetDir the target dir.
  @throws MojoExecutionException on error.