<commit_before>package com.atlassian.maven.plugins.amps.osgi;

import com.atlassian.maven.plugins.amps.AbstractAmpsMojo;
import com.atlassian.maven.plugins.amps.ProductArtifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.MavenProject;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.artifact.Artifact;
import org.apache.commons.io.FileUtils;
import org.jfrog.maven.annomojo.annotations.MojoGoal;
import org.jfrog.maven.annomojo.annotations.MojoParameter;
import org.jfrog.maven.annomojo.annotations.MojoComponent;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.archiver.jar.ManifestException;
import org.codehaus.plexus.archiver.ArchiverException;

import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.HashSet;
import java.io.File;
import java.io.IOException;

/**
 * Generates the obr artifact, containing the plugin, its dependencies, and the obr XML file.  The OBR file looks like
 * this:
 *
 * <pre>
 * this-plugin.jar
 * obr.xml
 * dependencies/required-plugin.jar
 * </pre>
 *
 * All plugins in the root directory will be installed, while the ones in the "dependencies" directory will be installed
 * only if they are needed.
 */
@MojoGoal("generate-obr-artifact")
public class GenerateObrArtifactMojo extends AbstractAmpsMojo
{
    @MojoParameter
    private List<PluginDependency> pluginDependencies = new ArrayList<PluginDependency>();

    /**
     * The Jar archiver.
     */
    @MojoComponent(role="org.codehaus.plexus.archiver.Archiver", roleHint="jar")
    private JarArchiver jarArchiver;

    /**
     * The archive configuration to use. See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven
     * Archiver Reference</a>.
     *
     * @since 2.1
     */
    @MojoParameter
    private MavenArchiveConfiguration archive = new MavenArchiveConfiguration();

    /**
     * Specifies whether or not to attach the artifact to the project
     */
    @MojoParameter(expression="${attach}", defaultValue="true")
    private boolean attach;

    /**
     * Used for attaching the source jar to the project.
     */
    @MojoComponent
    private MavenProjectHelper projectHelper;

    /**
     * The directory where the generated archive file will be put.
     */
    @MojoParameter(defaultValue="${project.build.directory}")
    protected File outputDirectory;

    /**
     * The filename to be used for the generated archive file.
     * For the source:jar goal, "-sources" is appended to this filename.
     * For the source:test-jar goal, "-test-sources" is appended.
     */
    @MojoParameter(defaultValue="${project.build.finalName}")
    protected String finalName;

    /**
     * Contains the full list of projects in the reactor.
     */
    @MojoParameter(expression="${reactorProjects}", readonly = true)
    protected List reactorProjects;

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException
    {
        try
        {
            List<File> deps = resolvePluginDependencies();
            File obrDir = layoutObr(deps, new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar"));
            generateObrZip(obrDir);
        }
        catch (IOException e)
        {<commit_msg>Get rid of java6 annotation<commit_after>package com.atlassian.maven.plugins.amps.osgi;

import com.atlassian.maven.plugins.amps.AbstractAmpsMojo;
import com.atlassian.maven.plugins.amps.ProductArtifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.MavenProject;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.artifact.Artifact;
import org.apache.commons.io.FileUtils;
import org.jfrog.maven.annomojo.annotations.MojoGoal;
import org.jfrog.maven.annomojo.annotations.MojoParameter;
import org.jfrog.maven.annomojo.annotations.MojoComponent;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.archiver.jar.ManifestException;
import org.codehaus.plexus.archiver.ArchiverException;

import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.HashSet;
import java.io.File;
import java.io.IOException;

/**
 * Generates the obr artifact, containing the plugin, its dependencies, and the obr XML file.  The OBR file looks like
 * this:
 *
 * <pre>
 * this-plugin.jar
 * obr.xml
 * dependencies/required-plugin.jar
 * </pre>
 *
 * All plugins in the root directory will be installed, while the ones in the "dependencies" directory will be installed
 * only if they are needed.
 */
@MojoGoal("generate-obr-artifact")
public class GenerateObrArtifactMojo extends AbstractAmpsMojo
{
    @MojoParameter
    private List<PluginDependency> pluginDependencies = new ArrayList<PluginDependency>();

    /**
     * The Jar archiver.
     */
    @MojoComponent(role="org.codehaus.plexus.archiver.Archiver", roleHint="jar")
    private JarArchiver jarArchiver;

    /**
     * The archive configuration to use. See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven
     * Archiver Reference</a>.
     *
     * @since 2.1
     */
    @MojoParameter
    private MavenArchiveConfiguration archive = new MavenArchiveConfiguration();

    /**
     * Specifies whether or not to attach the artifact to the project
     */
    @MojoParameter(expression="${attach}", defaultValue="true")
    private boolean attach;

    /**
     * Used for attaching the source jar to the project.
     */
    @MojoComponent
    private MavenProjectHelper projectHelper;

    /**
     * The directory where the generated archive file will be put.
     */
    @MojoParameter(defaultValue="${project.build.directory}")
    protected File outputDirectory;

    /**
     * The filename to be used for the generated archive file.
     * For the source:jar goal, "-sources" is appended to this filename.
     * For the source:test-jar goal, "-test-sources" is appended.
     */
    @MojoParameter(defaultValue="${project.build.finalName}")
    protected String finalName;

    /**
     * Contains the full list of projects in the reactor.
     */
    @MojoParameter(expression="${reactorProjects}", readonly = true)
    protected List reactorProjects;

    public void execute() throws MojoExecutionException, MojoFailureException
    {
        try
        {
            List<File> deps = resolvePluginDependencies();
            File obrDir = layoutObr(deps, new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".jar"));
            generateObrZip(obrDir);
        }
        catch (IOException e)
        {
{'fraction_non_alphanumeric': 0.10463816708577815, 'fraction_numerical': 0.0006985191394244202, 'mean_word_length': 3.772666666666667, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1571327', 'n_tokens_mistral': 2111, 'n_tokens_neox': 2031, 'n_words': 495}