Add all the artifact containers to the class path
179311
protected void addToClassPath(Iterable<ArtifactContainer> artifacts) {

        for (ArtifactContainer art : artifacts) {
            smartClassPath.addArtifactContainer(art);
        }
    }
754529
private static void appendSystemClasspath(JobConf conf,
                                            String pathSeparator,
                                            StringBuffer classPath) {
    // The alternate runtime can be used to debug tasks by putting a
    // custom version of the mapred libraries. This will get loaded before
    // the TT's jars.
    String debugRuntime = conf.get("mapred.task.debug.runtime.classpath");
    if (debugRuntime != null) {
      classPath.append(pathSeparator);
      classPath.append(debugRuntime);
    }
    // Determine system classpath for tasks. Default to tasktracker's
    // classpath.
    String systemClasspath = System.getenv(
      MAPREDUCE_TASK_SYSTEM_CLASSPATH_PROPERTY);
    if (systemClasspath == null) {
      systemClasspath = System.getProperty("java.class.path");
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("System classpath " + systemClasspath);
    }
    classPath.append(pathSeparator);
    classPath.append(systemClasspath);
  }
1282955
protected void addPackageResources(Package aPackage, Map<String, ClassResource> urlSet, ClassLoader[] classLoaders) {
        String packageName = aPackage.getName();
        String relativePath = getPackageRelativePath(packageName);
        List<URL> resources = getResources(relativePath, classLoaders);
        for (URL resource : resources) {
            String key = getJavaResourceKey(resource);
            urlSet.put(key, new ClassResource(packageName, resource));
        }
    }
372184
private void addDirectoryClasses(final Path location, final Path subPath) {
        for (final File file : location.toFile().listFiles()) {
            if (file.isDirectory())
                addDirectoryClasses(location.resolve(file.getName()), subPath.resolve(file.getName()));
            else if (file.isFile() && file.getName().endsWith(".class")) {
                final String classFileName = subPath.resolve(file.getName()).toString();
                classes.add(toQualifiedClassName(classFileName));
            }
        }
    }
1141171
def render_fetch_maven_artifacts(self):
        """"""
        phase = 'prebuild_plugins'
        plugin = 'fetch_maven_artifacts'
        if not self.dj.dock_json_has_plugin_conf(phase, plugin):
            return

        koji_hub = self.spec.kojihub.value
        koji_root = self.spec.kojiroot.value

        if not koji_hub and not koji_root:
            logger.info('Removing %s because kojihub and kojiroot were not specified', plugin)
            self.dj.remove_plugin(phase, plugin)
            return

        self.dj.dock_json_set_arg(phase, plugin, 'koji_hub', koji_hub)
        self.dj.dock_json_set_arg(phase, plugin, "koji_root", koji_root)

        if self.spec.artifacts_allowed_domains.value:
            self.dj.dock_json_set_arg(phase, plugin, 'allowed_domains',
                                      self.spec.artifacts_allowed_domains.value)
346861
def add_artifact(self, artifact):
        '''
        '''
        artifact.env_time = self.age
        self.artifacts.append(artifact)
        self._log(logging.DEBUG, "ARTIFACTS appended: '{}', length={}"
                  .format(artifact, len(self.artifacts)))
99559
def insert_paths(self, cache_key, paths):
    """"""
    with self._tmpfile(cache_key, 'write') as tmp:
      self._artifact(tmp.name).collect(paths)
      yield self._store_tarball(cache_key, tmp.name)
573446
def build(context, provider, **kwargs):  # pylint: disable=unused-argument
    """"""
    session = get_session(provider.region)
    options = kwargs.get('options', {})
    context_dict = {}
    context_dict['artifact_key_prefix'] = "%s-%s-" % (options['namespace'], options['name'])  # noqa
    default_param_name = "%shash" % context_dict['artifact_key_prefix']

    if options.get('build_output'):
        build_output = os.path.join(
            options['path'],
            options['build_output']
        )
    else:
        build_output = options['path']

    context_dict['artifact_bucket_name'] = RxrefLookup.handle(
        kwargs.get('artifact_bucket_rxref_lookup'),
        provider=provider,
        context=context
    )

    if options.get('pre_build_steps'):
        run_commands(options['pre_build_steps'], options['path'])

    context_dict['hash'] = get_hash_of_files(
        root_path=options['path'],
        directories=options.get('source_hashing', {}).get('directories')
    )

    # Now determine if the current staticsite has already been deployed
    if options.get('source_hashing', {}).get('enabled', True):
        context_dict['hash_tracking_parameter'] = options.get(
            'source_hashing', {}).get('parameter', default_param_name)

        ssm_client = session.client('ssm')

        try:
            old_parameter_value = ssm_client.get_parameter(
                Name=context_dict['hash_tracking_parameter']
            )['Parameter']['Value']
        except ssm_client.exceptions.ParameterNotFound:
            old_parameter_value = None
    else:
        context_dict['hash_tracking_disabled'] = True
        old_parameter_value = None

    context_dict['current_archive_filename'] = (
        context_dict['artifact_key_prefix'] + context_dict['hash'] + '.zip'
    )
    if old_parameter_value:
        context_dict['old_archive_filename'] = (
            context_dict['artifact_key_prefix'] + old_parameter_value + '.zip'
        )

    if old_parameter_value == context_dict['hash']:
        LOGGER.info("staticsite: skipping build; app hash %s already deployed "
                    "in this environment",
                    context_dict['hash'])
        context_dict['deploy_is_current'] = True
        return context_dict

    if does_s3_object_exist(context_dict['artifact_bucket_name'],
                            context_dict['current_archive_filename'],
                            session):
        context_dict['app_directory'] = download_and_extract_to_mkdtemp(
            context_dict['artifact_bucket_name'],
            context_dict['current_archive_filename'], session
        )
    else:
        if options.get('build_steps'):
            LOGGER.info('staticsite: executing build commands')
            run_commands(options['build_steps'], options['path'])
        zip_and_upload(build_output, context_dict['artifact_bucket_name'],
                       context_dict['current_archive_filename'], session)
        context_dict['app_directory'] = build_output

    context_dict['deploy_is_current'] = False
    return context_dict
549891
def addPharLapPaths(env):
    """"""
    ph_path = getPharLapPath()

    try:
        env_dict = env['ENV']
    except KeyError:
        env_dict = {}
        env['ENV'] = env_dict
    SCons.Util.AddPathIfNotExists(env_dict, 'PATH',
                                  os.path.join(ph_path, 'bin'))
    SCons.Util.AddPathIfNotExists(env_dict, 'INCLUDE',
                                  os.path.join(ph_path, 'include'))
    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',
                                  os.path.join(ph_path, 'lib'))
    SCons.Util.AddPathIfNotExists(env_dict, 'LIB',
                                  os.path.join(ph_path, os.path.normpath('lib/vclib')))
    
    env['PHARLAP_PATH'] = getPharLapPath()
    env['PHARLAP_VERSION'] = str(getPharLapVersion())
873451
void install(final File file, final Artifact artifact, final ArtifactRepository repo) 
            throws MojoExecutionException {
        File destFile = new File(repo.getBasedir() + File.separator
            + repo.getLayout().pathOf(artifact));
        destFile.getParentFile().mkdirs();
        try {
            FileUtils.copyFile(file, destFile);
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
826393
def _LoadArtifactsFromFiles(self, file_paths, overwrite_if_exists=True):
    """"""
    loaded_files = []
    loaded_artifacts = []
    for file_path in file_paths:
      try:
        with io.open(file_path, mode="r", encoding="utf-8") as fh:
          logging.debug("Loading artifacts from %s", file_path)
          for artifact_val in self.ArtifactsFromYaml(fh.read()):
            self.RegisterArtifact(
                artifact_val,
                source="file:%s" % file_path,
                overwrite_if_exists=overwrite_if_exists)
            loaded_artifacts.append(artifact_val)
            logging.debug("Loaded artifact %s from %s", artifact_val.name,
                          file_path)

        loaded_files.append(file_path)
      except (IOError, OSError) as e:
        logging.error("Failed to open artifact file %s. %s", file_path, e)
      except rdf_artifacts.ArtifactDefinitionError as e:
        logging.error("Invalid artifact found in file %s with error: %s",
                      file_path, e)
        raise

    # Once all artifacts are loaded we can validate.
    for artifact_value in loaded_artifacts:
      Validate(artifact_value)
908722
def build_artifacts=( artifacts )
      @resolver.clearBuildArtifacts()

      unless artifacts.is_a? Array
        artifacts = [artifacts]
      end

      artifacts.each do |artifact|
        # Hash of notation => path or notation => { :path =>, :pom => }
        if artifact.is_a? Hash

          notation, opts = artifact.shift

          if opts.is_a? Hash
            @resolver.add_build_artifact( notation, opts[:path], opts[:pom] )
          else
            @resolver.add_build_artifact( notation, opts )
          end

        else
          raise "invalid build_artifacts format"
        end
      end
    end
1107007
protected void addClassPathes(final GroovyClassLoader classLoader) {
        if (classpath != null) {
            for (int i = 0; i < classpath.list().length; i++) {
                classLoader.addClasspath(classpath.list()[i]);
            }
        }
    }
1018102
private T addNestedJarFileResource(final File resource, final ArchivePath target, final ArchivePath base)
        throws IllegalArgumentException {
        final Iterable<ClassLoader> classLoaders = ((Configurable) this.getArchive()).getConfiguration()
            .getClassLoaders();

        for (final ClassLoader classLoader : classLoaders) {
            final InputStream in = classLoader.getResourceAsStream(resourceAdjustedPath(resource));
            if (in != null) {
                final Asset asset = new ByteArrayAsset(in);
                return add(asset, base, target.get());
            }
        }
        throw new IllegalArgumentException(resource.getPath() + " was not found in any available ClassLoaders");
    }
1233935
def load_dependencies_to_classpath
      jars = dependencies_classpath.split(File::PATH_SEPARATOR)
      Naether::Java.load_jars(jars)

      jars
    end
939718
protected void setupMavenPaths() {

		if (getAddCompileSourceRoot()) {
			getProject().addCompileSourceRoot(getGenerateDirectory().getPath());
		}
		if (getAddTestCompileSourceRoot()) {
			getProject().addTestCompileSourceRoot(getGenerateDirectory().getPath());
		}
		if (getEpisode() && getEpisodeFile() != null) {
			final String episodeFilePath = getEpisodeFile().getAbsolutePath();
			final String generatedDirectoryPath = getGenerateDirectory().getAbsolutePath();

			if (episodeFilePath.startsWith(generatedDirectoryPath + File.separator)) {
				final String path = episodeFilePath.substring(generatedDirectoryPath.length() + 1);

				final Resource resource = new Resource();
				resource.setDirectory(generatedDirectoryPath);
				resource.addInclude(path);
				if (getAddCompileSourceRoot()) {
					getProject().addResource(resource);
				}
				if (getAddTestCompileSourceRoot()) {
					getProject().addTestResource(resource);

				}
			}
		}
	}
1039658
private File buildWar(List<ArtifactOrFile> classPathEntries) {
        try {
            List<String> classesUrls = classPathEntries.stream()
                    .map(ArtifactOrFile::file)
                    .filter(this::isDirectory)
                    .filter(url -> url.contains("classes"))
                    .collect(Collectors.toList());

            List<File> classpathJars = classPathEntries.stream()
                    .map(ArtifactOrFile::file)
                    .filter(file -> file.endsWith(".jar"))
                    .map(File::new)
                    .collect(Collectors.toList());

            return WarBuilder.build(classesUrls, classpathJars);
        } catch (IOException e) {
            throw new RuntimeException("failed to build war", e);
        }
    }