<commit_before>package io.vertx.it.plugin;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.exec.OS;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.*;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.MavenResourcesExecution;
import org.apache.maven.shared.filtering.MavenResourcesFiltering;

import java.io.File;
import java.io.IOException;
import java.util.*;

@Mojo(name = "run-it", threadSafe = false,
    requiresDependencyResolution = ResolutionScope.COMPILE,
    requiresProject = true,
    defaultPhase = LifecyclePhase.INTEGRATION_TEST)
public class VertxITMojo extends AbstractMojo {

  /**
   * The maven project.
   */
  @Parameter(defaultValue = "${project}", readonly = true)
  public MavenProject project;

  /**
   * The project base directory.
   */
  @Parameter(defaultValue = "${basedir}", required = true, readonly = true)
  public File basedir;
  /**
   * The target directory of the project.
   */
  @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true)
  public File buildDirectory;

  @Parameter(defaultValue = "${vertx.home}", required = true)
  public File vertxHome;

  @Parameter(required = true)
  public File outputDirectory;

  @Parameter(required = true)
  public File inputDirectory;

  @Parameter(defaultValue = "${tag}")
  public String tag;

  @Parameter(defaultValue = "${exec}")
  public String exec;

  @Parameter(defaultValue = "${exec.includes}")
  public String includes;

  @Parameter(defaultValue = "${exec.excludes}")
  public String excludes;

  @Parameter(defaultValue = "${interface}")
  public String itf;

  @Component
  public MavenSession session;

  @Component
  public MavenResourcesFiltering filtering;

  @Parameter
  public Properties additionalProperties;

  @Parameter(defaultValue = "${project.compileClasspathElements}", required = false)
  private List<String> classpathElements;

  /**
   * The JAVA_HOME value.
   */
  @Parameter(defaultValue = "${java.home}", required = true, readonly = true)
  public File javaHome;

  private Set<Run> runs = new LinkedHashSet<>();
  private ExecutionSelector selector;

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    if (exec != null && tag != null) {
      throw new MojoExecutionException("Cannot use the `tag` and `exec` parameters together");
    }

    if (exec != null  && (includes != null  || excludes != null)) {
      throw new MojoExecutionException("Cannot use the `exec` and `includes/excludes` parameters together");
    }

    // Manage selector
    selector = new ExecutionSelector(null, null, null);
    if (exec != null) {
      if (exec.contains("#")) {
        selector = new ExecutionSelector(exec, null, null);
      } else {
        selector = new ExecutionSelector(exec + "#*", null, null);
      }
    } else if (excludes != null  || includes != null) {
      selector = new ExecutionSelector(includes, excludes, null);
    } else if (tag != null) {
      selector = new ExecutionSelector(null, null, tag);
    }

    if (vertxHome == null) {
      throw new MojoExecutionException("vert.x home not defined");
    }<commit_msg>Convert additional properties to system properties.<commit_after>package io.vertx.it.plugin;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.exec.OS;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.*;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.MavenResourcesExecution;
import org.apache.maven.shared.filtering.MavenResourcesFiltering;

import java.io.File;
import java.io.IOException;
import java.util.*;

@Mojo(name = "run-it", threadSafe = false,
    requiresDependencyResolution = ResolutionScope.COMPILE,
    requiresProject = true,
    defaultPhase = LifecyclePhase.INTEGRATION_TEST)
public class VertxITMojo extends AbstractMojo {

  /**
   * The maven project.
   */
  @Parameter(defaultValue = "${project}", readonly = true)
  public MavenProject project;

  /**
   * The project base directory.
   */
  @Parameter(defaultValue = "${basedir}", required = true, readonly = true)
  public File basedir;
  /**
   * The target directory of the project.
   */
  @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true)
  public File buildDirectory;

  @Parameter(defaultValue = "${vertx.home}", required = true)
  public File vertxHome;

  @Parameter(required = true)
  public File outputDirectory;

  @Parameter(required = true)
  public File inputDirectory;

  @Parameter(defaultValue = "${tag}")
  public String tag;

  @Parameter(defaultValue = "${exec}")
  public String exec;

  @Parameter(defaultValue = "${exec.includes}")
  public String includes;

  @Parameter(defaultValue = "${exec.excludes}")
  public String excludes;

  @Parameter(defaultValue = "${interface}")
  public String itf;

  @Component
  public MavenSession session;

  @Component
  public MavenResourcesFiltering filtering;

  @Parameter
  public Properties additionalProperties;

  @Parameter(defaultValue = "${project.compileClasspathElements}", required = false)
  private List<String> classpathElements;

  /**
   * The JAVA_HOME value.
   */
  @Parameter(defaultValue = "${java.home}", required = true, readonly = true)
  public File javaHome;

  private Set<Run> runs = new LinkedHashSet<>();
  private ExecutionSelector selector;

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    if (exec != null && tag != null) {
      throw new MojoExecutionException("Cannot use the `tag` and `exec` parameters together");
    }

    if (exec != null && (includes != null || excludes != null)) {
      throw new MojoExecutionException("Cannot use the `exec` and `includes/excludes` parameters together");
    }

    // Manage selector
    selector = new ExecutionSelector(null, null, null);
    if (exec != null) {
      if (exec.contains("#")) {
        selector = new ExecutionSelector(exec, null, null);
      } else {
        selector = new ExecutionSelector(exec + "#*", null, null);
      }
    } else if (excludes != null || includes != null) {
      selector = new ExecutionSelector(includes, excludes, null);
    } else if (tag != null) {
      selector = new ExecutionSelector(null, null, tag);
    }

    if (vertxHome == null) {
      throw new MojoExecutionException("vert.x home not defined");
    }

    // Publish the additional properties as system properties
    if (additionalProperties != null) {
      for (String n : additionalProperties.stringPropertyNames()) {
        System.setProperty(n, additionalProperties.getProperty(n));
      }
    }
{'fraction_non_alphanumeric': 0.11892517356646953, 'fraction_numerical': 0.0, 'mean_word_length': 4.238383838383839, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4234365', 'n_tokens_mistral': 2236, 'n_tokens_neox': 2166, 'n_words': 555}