Create an executable jar to generate the report. Created jar contains only
allure configuration file.
773530
protected String getExecutableJar() throws IOException {
        Manifest manifest = new Manifest();
        manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
        manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, MAIN);
        manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, getClasspath());

        Path jar = createTempDirectory("exec").resolve("generate.jar");
        try (JarOutputStream output = new JarOutputStream(Files.newOutputStream(jar), manifest)) {
            output.putNextEntry(new JarEntry("allure.properties"));
            Path allureConfig = PROPERTIES.getAllureConfig();
            if (Files.exists(allureConfig)) {
                byte[] bytes = Files.readAllBytes(allureConfig);
                output.write(bytes);
            }
            output.closeEntry();
        }

        return jar.toAbsolutePath().toString();
    }
556746
@Override
    public void create() {
        if (!environment.isProd()) {
            config.serverConfigs().forEach((key, serverConfig) -> {
                String evolutionScript = generateEvolutionScript(servers.get(key));
                if (evolutionScript != null) {
                    File evolutions = environment.getFile("conf/evolutions/" + key + "/1.sql");
                    try {
                        String content = "";
                        if (evolutions.exists()) {
                            content = new String(Files.readAllBytes(evolutions.toPath()), "utf-8");
                        }

                        if (content.isEmpty() || content.startsWith("# --- Created by Ebean DDL")) {
                            environment.getFile("conf/evolutions/" + key).mkdirs();
                            if (!content.equals(evolutionScript)) {
                                Files.write(evolutions.toPath(), evolutionScript.getBytes("utf-8"));
                            }
                        }
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
1204527
private void createExecutableSettings()
	{

		executablePathLabel = new JLabel("Path to executables: ");
		executablePathLabel.setBounds(10, 10, 250, 25);
		this.add(executablePathLabel);

		// ------------------------------------------------------------------//
		// 7ZIP / P7ZIP SETTINGS //
		// ------------------------------------------------------------------//

		sevenZipEnableBox = new JCheckBox();
		sevenZipEnableBox.setBounds(10, 45, 25, 25);

		this.add(sevenZipEnableBox);

		sevenZipLabel = new JLabel("7Zip Executable: ");
		sevenZipLabel.setBorder(BorderFactory.createRaisedBevelBorder());
		sevenZipLabel.setBounds(40, 45, 120, 25);
		this.add(sevenZipLabel);

		sevenZipPathField = new JTextField();
		sevenZipPathField.setBounds(170, 45, 300, 25);
		this.add(sevenZipPathField);

		sevenZipSearchButton = new JButton("Search");
		sevenZipSearchButton.setBounds(480, 45, 80, 25);

		sevenZipSearchButton.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(final ActionEvent e)
			{

				JFileChooser fc = new JFileChooser();
				if (fc.showOpenDialog(new JPanel()) == JFileChooser.APPROVE_OPTION) {
					sevenZipPathField.setText(fc.getSelectedFile().getPath());
				}
			}
		});

		this.add(sevenZipSearchButton);

		sevenZipEnableBox.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(final ActionEvent e)
			{
				boolean flag = !controller.is7ZipEnabled();
				controller.setEnable7Zip(flag);

				sevenZipLabel.setEnabled(flag);
				sevenZipPathField.setEnabled(flag);
				sevenZipSearchButton.setEnabled(flag);
			}
		});

	}
330030
def execute(self):
    
    if JvmResolveSubsystem.global_instance().get_options().resolver != 'ivy':
      return

    compile_classpath = self.context.products.get_data('compile_classpath',
        init_func=ClasspathProducts.init_func(self.get_options().pants_workdir))

    targets = self.context.targets()
    if all(not isinstance(target, JarLibrary) for target in targets):
      if self._report:
        self.context.log.info("Not generating a report. No resolution performed.")
      return

    executor = self.create_java_executor()
    results = self.resolve(executor=executor,
                                      targets=targets,
                                      classpath_products=compile_classpath,
                                      confs=self.get_options().confs,
                                      extra_args=self._args)
    if self._report:
      results_with_resolved_artifacts = [r for r in results if r.has_resolved_artifacts]

      if not results_with_resolved_artifacts:
        self.context.log.info("Not generating a report. No resolution performed.")
      else:
        for result in results_with_resolved_artifacts:
          self._generate_ivy_report(result)
845364
@Override
    public void execute() throws BuildException {
        try {
            ProvisioningFeatureDefinition feature = new SubsystemFeatureDefinitionImpl(null, this.featureManifestFile);
            String description = generateDescriptionHtml(feature, this.generateKnowledgeCentreLinks, this.licenseType);
            Files.write(this.descriptionHtmlOutputFile.toPath(), description.getBytes());
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
972752
def _get_runner(classpath, main, jvm_options, args, executor,
               cwd, distribution,
               create_synthetic_jar, synthetic_jar_dir):
  """"""

  executor = executor or SubprocessExecutor(distribution)

  safe_cp = classpath
  if create_synthetic_jar:
    safe_cp = safe_classpath(classpath, synthetic_jar_dir)
    logger.debug('Bundling classpath {} into {}'.format(':'.join(classpath), safe_cp))

  return executor.runner(safe_cp, main, args=args, jvm_options=jvm_options, cwd=cwd)
1109339
private File createArchive() throws Exception {
        getLog().info("Creating archive.");
        Artifact artifact = mavenProject.getArtifact();
        String clsfr = noclassifier ? "" : ("-" + classifier);
        String archiveName = artifact.getArtifactId() + "-" + artifact.getVersion() + clsfr + ".jar";
        File jarFile = new File(mavenProject.getBuild().getDirectory(), archiveName);
        MavenArchiver archiver = new MavenArchiver();
        jarArchiver.addDirectory(stagingDirectory);
        archiver.setArchiver(jarArchiver);
        archiver.setOutputFile(jarFile);
        archiver.createArchive(mavenSession, mavenProject, archiveConfig);
        
        if (noclassifier) {
            artifact.setFile(jarFile);
        } else {
            projectHelper.attachArtifact(mavenProject, jarFile, classifier);
        }
        
        FileUtils.deleteDirectory(stagingDirectory);
        return jarFile;
    }
60693
private Manifest createManifest( File jar, Map<String, String> manifestentries )
            throws MojoExecutionException
    {
        JarFile jarFile = null;
        try
        {
            jarFile = new JarFile( jar );

            // read manifest from jar
            Manifest manifest = jarFile.getManifest();

            if ( manifest == null || manifest.getMainAttributes().isEmpty() )
            {
                manifest = new Manifest();
                manifest.getMainAttributes().putValue( Attributes.Name.MANIFEST_VERSION.toString(), "1.0" );
            }

            // add or overwrite entries
            Set<Map.Entry<String, String>> entrySet = manifestentries.entrySet();
            for ( Map.Entry<String, String> entry : entrySet )
            {
                manifest.getMainAttributes().putValue( entry.getKey(), entry.getValue() );
            }

            return manifest;
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error while reading manifest from " + jar.getAbsolutePath(), e );
        }
        finally
        {
            ioUtil.close( jarFile );
        }
    }
716265
private static void createSimpleProject( File targetDirectory, CreationBean creationBean )
	throws IOException {

		// Create the directory structure
		String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES;
		for( String s : directoriesToCreate ) {
			File dir = new File( targetDirectory, s );
			Utils.createDirectory( dir );
		}

		// Create the descriptor
		InputStream in = ProjectUtils.class.getResourceAsStream( "/application-skeleton.props" );
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		Utils.copyStreamSafely( in, out );
		String tpl = out.toString( "UTF-8" )
				.replace( TPL_NAME, creationBean.getProjectName())
				.replace( TPL_VERSION, creationBean.getProjectVersion())
				.replace( TPL_DESCRIPTION, creationBean.getProjectDescription());

		// Create the rest of the project
		completeProjectCreation( targetDirectory, tpl, creationBean );
	}
374214
public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        File jarFile = new File( outputDirectory, finalName + ".jar" );
        File origJarFile = new File( outputDirectory, finalName + "-b4gwt.jar" );
        if ( origJarFile.exists() )
        {
            if ( !origJarFile.delete() )
            {
                throw new MojoExecutionException( "Error removing " + origJarFile );
            }
        }
        if ( !jarFile.renameTo( origJarFile ) )
        {
            throw new MojoExecutionException( "Error renaming " + jarFile + " to " + origJarFile );
        }

        MavenArchiver archiver = new MavenArchiver();

        archiver.setArchiver( jarArchiver );
        archiver.setOutputFile( jarFile );
        archive.setForced( false );
        // It is already created by maven-jar-plugin
        archive.setAddMavenDescriptor( false );

        Collection<ResourceFile> files = getAllResourceFiles();
        try
        {

            // Avoid annoying messages in log "com/package/Ccc.java already added, skipping"
            List<String> jarExcludes = new Vector<String>();

            // Add Sources first since they may already be present in jar from previous run and changed.
            for ( ResourceFile file : files )
            {
                jarArchiver.addFile( new File( file.basedir, file.fileRelativeName ), file.fileRelativeName );
                jarExcludes.add( file.fileRelativeName );
            }

            // Add the context of original jar excluding resources that we just added base on GWT descriptors
            jarArchiver.addArchivedFileSet( origJarFile, null, jarExcludes.toArray( new String[jarExcludes.size()] ) );

            archiver.createArchive( session , getProject(), archive );
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( "Error assembling JAR", e );
        }

    }
810690
public static File createTemporaryEmptyCatalogJarFile(boolean isXDCR) throws IOException {
        File emptyJarFile = File.createTempFile("catalog-empty", ".jar");
        emptyJarFile.deleteOnExit();
        VoltCompiler compiler = new VoltCompiler(isXDCR);
        if (!compiler.compileEmptyCatalog(emptyJarFile.getAbsolutePath())) {
            return null;
        }
        return emptyJarFile;
    }
526478
public void configure() throws CoreException {
    String path =
        project.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID,
            "hadoop.runtime.path"));

    File dir = new File(path);
    final ArrayList<File> coreJars = new ArrayList<File>();
    dir.listFiles(new FileFilter() {
      public boolean accept(File pathname) {
        String fileName = pathname.getName();

        // get the hadoop core jar without touching test or examples
        // older version of hadoop don't use the word "core" -- eyhung
        if ((fileName.indexOf("hadoop") != -1) && (fileName.endsWith("jar"))
            && (fileName.indexOf("test") == -1)
            && (fileName.indexOf("examples") == -1)) {
          coreJars.add(pathname);
        }

        return false; // we don't care what this returns
      }
    });
    File dir2 = new File(path + File.separatorChar + "lib");
    if (dir2.exists() && dir2.isDirectory()) {
      dir2.listFiles(new FileFilter() {
        public boolean accept(File pathname) {
          if ((!pathname.isDirectory())
              && (pathname.getName().endsWith("jar"))) {
            coreJars.add(pathname);
          }

          return false; // we don't care what this returns
        }
      });
    }

    // Add Hadoop libraries onto classpath
    IJavaProject javaProject = JavaCore.create(getProject());
    // Bundle bundle = Activator.getDefault().getBundle();
    try {
      IClasspathEntry[] currentCp = javaProject.getRawClasspath();
      IClasspathEntry[] newCp =
          new IClasspathEntry[currentCp.length + coreJars.size()];
      System.arraycopy(currentCp, 0, newCp, 0, currentCp.length);

      final Iterator<File> i = coreJars.iterator();
      int count = 0;
      while (i.hasNext()) {
        // for (int i = 0; i < s_coreJarNames.length; i++) {

        final File f = (File) i.next();
        // URL url = FileLocator.toFileURL(FileLocator.find(bundle, new
        // Path("lib/" + s_coreJarNames[i]), null));
        URL url = f.toURI().toURL();
        log.finer("hadoop library url.getPath() = " + url.getPath());

        newCp[newCp.length - 1 - count] =
            JavaCore.newLibraryEntry(new Path(url.getPath()), null, null);
        count++;
      }

      javaProject.setRawClasspath(newCp, new NullProgressMonitor());
    } catch (Exception e) {
      log.log(Level.SEVERE, "IOException generated in "
          + this.getClass().getCanonicalName(), e);
    }
  }
645892
public static JarFile createJar() throws IOException, URISyntaxException {
		URL location = faspmanager2.class.getProtectionDomain().getCodeSource().getLocation();
		return new JarFile(new File(location.toURI()));
	}
791846
def version_jar(self):
		
		cmd = config.get_command('java')
		cmd.append('-jar')
		cmd += self.cmd
		self.version(cmd=cmd, path=self.cmd[0])
1156471
private void processComponentJar(URL jarFileURL, WorkList workList, List<String> implicitClasspath) {
        LOG.debug("Processing {}", jarFileURL);

        if (!jarFileURL.toString().endsWith(".zip") && !jarFileURL.toString().endsWith(".jar")) {
            return;
        }

        try {
            URL manifestURL = new URL("jar:" + jarFileURL.toString() + "!/META-INF/MANIFEST.MF");

            InputStream in = null;
            try {
                in = manifestURL.openStream();
                Manifest manifest = new Manifest(in);

                Attributes mainAttrs = manifest.getMainAttributes();
                String classPath = mainAttrs.getValue("Class-Path");
                if (classPath != null) {
                    String[] fileList = classPath.split("\\s+");

                    for (String jarFile : fileList) {
                        URL referencedURL = workList.createRelativeURL(jarFileURL, jarFile);
                        if (workList.add(new WorkListItem(referencedURL))) {
                            implicitClasspath.add(referencedURL.toString());
                            LOG.debug("Implicit jar: {}", referencedURL);
                        }
                    }
                }
            } finally {
                if (in != null) {
                    in.close();
                }
            }
        } catch (IOException ignore) {
            // Ignore
        }
    }
415202
public static File toJar(File sourceDir, String jarName) {
		if (!sourceDir.isAbsolute()) {
			throw new IllegalArgumentException("Source must be expressed through absolute path");
		}
		Manifest manifest = new Manifest();
		manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
		File jarFile = new File(jarName);
		try {
			JarOutputStream target = new JarOutputStream(new FileOutputStream(jarFile), manifest);
			add(sourceDir, sourceDir.getAbsolutePath().length(), target);
			target.close();
		}
		catch (Exception e) {
			throw new IllegalStateException("Failed to create JAR file '"
					+ jarName + "' from " + sourceDir.getAbsolutePath(), e);
		}
		return jarFile;
	}
1085263
@Override
	public ArchivedExecutionConfig getArchivedExecutionConfig() {
		// create a summary of all relevant data accessed in the web interface's JobConfigHandler
		try {
			ExecutionConfig executionConfig = jobInformation.getSerializedExecutionConfig().deserializeValue(userClassLoader);
			if (executionConfig != null) {
				return executionConfig.archive();
			}
		} catch (IOException | ClassNotFoundException e) {
			LOG.error("Couldn't create ArchivedExecutionConfig for job {} ", getJobID(), e);
		}
		return null;
	}