• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python maven_artifact.MavenArtifact类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中maven_artifact.MavenArtifact的典型用法代码示例。如果您正苦于以下问题:Python MavenArtifact类的具体用法?Python MavenArtifact怎么用?Python MavenArtifact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了MavenArtifact类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_maven_artifact

    def test_maven_artifact(self):
        artifact1 = MavenArtifact.createFromGAV("org.jboss:jboss-parent:pom:10")
        self.assertEqual(artifact1.groupId, "org.jboss")
        self.assertEqual(artifact1.artifactId, "jboss-parent")
        self.assertEqual(artifact1.version, "10")
        self.assertEqual(artifact1.getArtifactType(), "pom")
        self.assertEqual(artifact1.getClassifier(), "")
        self.assertEqual(artifact1.getArtifactFilename(), "jboss-parent-10.pom")
        self.assertEqual(artifact1.getArtifactFilepath(), "org/jboss/jboss-parent/10/jboss-parent-10.pom")

        artifact2 = MavenArtifact.createFromGAV("org.jboss:jboss-foo:jar:1.0")
        self.assertEqual(artifact2.getArtifactFilepath(), "org/jboss/jboss-foo/1.0/jboss-foo-1.0.jar")
        self.assertEqual(artifact2.getPomFilepath(), "org/jboss/jboss-foo/1.0/jboss-foo-1.0.pom")
        self.assertEqual(artifact2.getSourcesFilepath(), "org/jboss/jboss-foo/1.0/jboss-foo-1.0-sources.jar")

        artifact3 = MavenArtifact.createFromGAV("org.jboss:jboss-test:jar:client:2.0.0.Beta1")
        self.assertEqual(artifact3.getClassifier(), "client")
        self.assertEqual(artifact3.getArtifactFilename(), "jboss-test-2.0.0.Beta1-client.jar")
        self.assertEqual(artifact3.getArtifactFilepath(),
                "org/jboss/jboss-test/2.0.0.Beta1/jboss-test-2.0.0.Beta1-client.jar")

        artifact4 = MavenArtifact.createFromGAV("org.acme:jboss-bar:jar:1.0-alpha-1:compile")
        self.assertEqual(artifact4.getArtifactFilepath(), "org/acme/jboss-bar/1.0-alpha-1/jboss-bar-1.0-alpha-1.jar")

        artifact5 = MavenArtifact.createFromGAV("com.google.guava:guava:pom:r05")
        self.assertEqual(artifact5.groupId, "com.google.guava")
        self.assertEqual(artifact5.artifactId, "guava")
        self.assertEqual(artifact5.version, "r05")
        self.assertEqual(artifact5.getArtifactType(), "pom")
        self.assertEqual(artifact5.getClassifier(), "")
        self.assertEqual(artifact5.getArtifactFilename(), "guava-r05.pom")
开发者ID:jdcasey,项目名称:maven-repository-builder,代码行数:31,代码来源:tests.py


示例2: _addArtifact

    def _addArtifact(self, artifacts, groupId, artifactId, version, extsAndClass, suffix, url):
        pomMain = True
        # The pom is main only if no other main artifact is available
        if len(extsAndClass) > 1 and self._containsMainArtifact(extsAndClass) and "pom" in extsAndClass:
            pomMain = False

        artTypes = []
        for ext, classifiers in extsAndClass.iteritems():
            main = ext == "pom" and pomMain
            if not main:
                for classifier in classifiers:
                    extClassifier = "%s:%s" % (ext, classifier or "")
                    main = extClassifier not in self.notMainExtClassifiers
                    if main:
                        break
            artTypes.append(ArtifactType(ext, main, classifiers))

        mavenArtifact = MavenArtifact(groupId, artifactId, None, version)
        if suffix is not None:
            mavenArtifact.snapshotVersionSuffix = suffix
        if mavenArtifact in artifacts:
            artifacts[mavenArtifact].merge(ArtifactSpec(url, artTypes))
        else:
            logging.debug("Adding artifact %s", str(mavenArtifact))
            artifacts[mavenArtifact] = ArtifactSpec(url, artTypes)
开发者ID:jboss-eap,项目名称:maven-repository-builder,代码行数:25,代码来源:artifact_list_builder.py


示例3: _addArtifact

 def _addArtifact(self, artifacts, groupId, artifactId, version, extsAndClass, suffix, url):
     if len(extsAndClass) > 1 and self._containsNonPomWithoutClassifier(extsAndClass) and "pom" in extsAndClass:
         del extsAndClass["pom"]
     for ext in extsAndClass:
         mavenArtifact = MavenArtifact(groupId, artifactId, ext, version)
         if suffix is not None:
             mavenArtifact.snapshotVersionSuffix = suffix
         logging.debug("Adding artifact %s", str(mavenArtifact))
         artifacts[mavenArtifact] = ArtifactSpec(url, extsAndClass[ext])
开发者ID:wfkbuilder,项目名称:maven-repository-builder,代码行数:9,代码来源:artifact_list_builder.py


示例4: _filterExcludedTypes

    def _filterExcludedTypes(self, artifactList):
        '''
        Filter artifactList removing GAVs with specified main types only, otherwise keeping GAVs with
        not-excluded artifact types only.

        :param artifactList: artifactList to be filtered.
        :param exclTypes: list of excluded types
        :returns: artifactList without artifacts that matched specified types and had no other main types.
        '''
        logging.debug("Filtering artifacts with excluded types.")
        regExps = maven_repo_util.getRegExpsFromStrings(self.config.gatcvWhitelist)
        exclTypes = self.config.excludedTypes
        for ga in artifactList.keys():
            for priority in artifactList[ga].keys():
                for version in artifactList[ga][priority].keys():
                    artSpec = artifactList[ga][priority][version]
                    for artType in list(artSpec.artTypes.keys()):
                        if artType in exclTypes:
                            artTypeObj = artSpec.artTypes[artType]
                            classifiers = artTypeObj.classifiers
                            (groupId, artifactId) = ga.split(':')
                            for classifier in list(classifiers):
                                art = MavenArtifact(groupId, artifactId, artType, version, classifier)
                                gatcv = art.getGATCV()
                                if not maven_repo_util.somethingMatch(regExps, gatcv):
                                    logging.debug("Dropping classifier \"%s\" of %s:%s:%s from priority %i because of "
                                                  "excluded type.", classifier, ga, artType, version, priority)
                                    classifiers.remove(classifier)
                                else:
                                    logging.debug("Skipping drop of %s:%s:%s:%s from priority %i because it matches a "
                                                  "whitelist pattern.", ga, artType, classifier, version, priority)
                            if not classifiers:
                                logging.debug("Dropping %s:%s:%s from priority %i because of no classifier left.", ga,
                                              artType, version, priority)
                                del(artSpec.artTypes[artType])
                    noMain = True
                    for artType in artSpec.artTypes.keys():
                        artTypeObj = artSpec.artTypes[artType]
                        if artTypeObj.mainType:
                            noMain = False
                            break
                    if not artSpec.artTypes or noMain:
                        if noMain:
                            logging.debug("Dropping GAV %s:%s from priority %i because of no main artifact left.",
                                          ga, version, priority)
                        else:
                            logging.debug("Dropping GAV %s:%s from priority %i because of no artifact type left.",
                                          ga, version, priority)
                        del artifactList[ga][priority][version]
                if not artifactList[ga][priority]:
                    logging.debug("Dropping GA %s from priority %i because of no version left.", ga, priority)
                    del artifactList[ga][priority]
            if not artifactList[ga]:
                logging.debug("Dropping GA %s because of no priority left.", ga)
                del artifactList[ga]
        return artifactList
开发者ID:fkujikis,项目名称:maven-repository-builder,代码行数:56,代码来源:filter.py


示例5: test_listDependencies

    def test_listDependencies(self):
        config = configuration.Configuration()
        config.allClassifiers = True
        repoUrls = ['http://repo.maven.apache.org/maven2/']
        gavs = [
            'com.sun.faces:jsf-api:2.0.11',
            'org.apache.ant:ant:1.8.0'
        ]
        dependencies = {
            'javax.servlet:javax.servlet-api:jar:3.0.1': set(['javadoc', 'sources']),
            'javax.servlet.jsp.jstl:jstl-api:jar:1.2': set(['javadoc', 'sources']),
            'xml-apis:xml-apis:jar:1.3.04': set(['source', 'sources']),
            'javax.servlet:servlet-api:jar:2.5': set(['sources']),
            'javax.el:javax.el-api:jar:2.2.1': set(['javadoc', 'sources']),
            'junit:junit:jar:3.8.2': set(['javadoc', 'sources']),
            'xerces:xercesImpl:jar:2.9.0': set([]),
            'javax.servlet.jsp:jsp-api:jar:2.1': set(['sources']),
            'javax.servlet.jsp:javax.servlet.jsp-api:jar:2.2.1': set(['javadoc', 'sources']),
            'org.apache.ant:ant-launcher:jar:1.8.0': set([])
        }
        expectedArtifacts = {}
        for dep in dependencies:
            artifact = MavenArtifact.createFromGAV(dep)
            expectedArtifacts[artifact] = ArtifactSpec(repoUrls[0], dependencies[dep])

        builder = artifact_list_builder.ArtifactListBuilder(config)
        actualArtifacts = builder._listDependencies(repoUrls, gavs, False, False)

        self.assertEqualArtifactList(expectedArtifacts, actualArtifacts)
开发者ID:jdcasey,项目名称:maven-repository-builder,代码行数:29,代码来源:tests.py


示例6: generateArtifactList

def generateArtifactList(options, args):
    """
    Generates artifact "list" from sources defined in the given configuration in options. The result
    is dictionary with following structure:

    <repo url> (string)
      L list of MavenArtifact
    """

    artifactList = _generateArtifactList(options, args)
    #build sane structure - url to MavenArtifact list
    urlToMAList = {}
    for ga in artifactList:
        priorityList = artifactList[ga]
        for priority in priorityList:
            versionList = priorityList[priority]
            for version in versionList:
                artSpec = versionList[version]
                url = artSpec.url
                for artType in artSpec.artTypes.keys():
                    for classifier in artSpec.artTypes[artType].classifiers:
                        if classifier:
                            gatcv = "%s:%s:%s:%s" % (ga, artType, classifier, version)
                        else:
                            gatcv = "%s:%s:%s" % (ga, artType, version)
                        artifact = MavenArtifact.createFromGAV(gatcv)
                        urlToMAList.setdefault(url, []).append(artifact)
    return urlToMAList
开发者ID:jboss-eap,项目名称:maven-repository-builder,代码行数:28,代码来源:artifact_list_generator.py


示例7: generateArtifactList

def generateArtifactList(options):
    """
    Generates artifact "list" from sources defined in the given configuration in options. The result
    is dictionary with following structure:

    <repo url> (string)
      L artifacts (list of MavenArtifact)
    """

    options.allclassifiers = (options.classifiers == '__all__')

    artifactList = _generateArtifactList(options)
    #build sane structure - url to MavenArtifact list
    urlToMAList = {}
    for gat in artifactList:
        priorityList = artifactList[gat]
        for priority in priorityList:
            versionList = priorityList[priority]
            for version in versionList:
                artSpec = versionList[version]
                url = artSpec.url
                for classifier in artSpec.classifiers:
                    if classifier == "" or options.allclassifiers:
                        artifact = MavenArtifact.createFromGAV(gat + ((":" + classifier) if classifier else "") +
                                                               ":" + version)
                        urlToMAList.setdefault(url, []).append(artifact)
    return urlToMAList
开发者ID:VaclavDedik,项目名称:maven-repository-builder,代码行数:27,代码来源:artifact_list_generator.py


示例8: test_listRepository_file

    def test_listRepository_file(self):
        config = configuration.Configuration()
        config.allClassifiers = True
        repoUrls = ['file://./tests/testrepo']
        gavPatterns = [
            'bar:foo-bar:1.1',
            'foo.baz:baz-core:1.0'
        ]

        builder = artifact_list_builder.ArtifactListBuilder(config)
        actualArtifacts = builder._listRepository(repoUrls, gavPatterns)
        expectedArtifacts = {
            MavenArtifact.createFromGAV(gavPatterns[0]): ArtifactSpec(repoUrls[0], set([])),
            MavenArtifact.createFromGAV(gavPatterns[1]): ArtifactSpec(repoUrls[0], set(['javadoc', 'sources']))
        }

        self.assertEqualArtifactList(expectedArtifacts, actualArtifacts)
开发者ID:jdcasey,项目名称:maven-repository-builder,代码行数:17,代码来源:tests.py


示例9: test_listRepository_http

    def test_listRepository_http(self):
        config = configuration.Configuration()
        config.allClassifiers = True
        repoUrls = ['http://repo.maven.apache.org/maven2/']
        gavPatterns = [
            'com.sun.faces:jsf-api:2.0.11',
            'org.apache.ant:ant:1.8.0'
        ]

        builder = artifact_list_builder.ArtifactListBuilder(config)
        actualArtifacts = builder._listRepository(repoUrls, gavPatterns)
        expectedArtifacts = {
            MavenArtifact.createFromGAV(gavPatterns[0]): ArtifactSpec(repoUrls[0], set(['javadoc', 'sources'])),
            MavenArtifact.createFromGAV(gavPatterns[1]): ArtifactSpec(repoUrls[0], set([]))
        }

        self.assertEqualArtifactList(expectedArtifacts, actualArtifacts)
开发者ID:jdcasey,项目名称:maven-repository-builder,代码行数:17,代码来源:tests.py


示例10: findArtifact

        def findArtifact(gav, urls, artifacts):
            artifact = MavenArtifact.createFromGAV(gav)
            for url in urls:
                if maven_repo_util.gavExists(url, artifact):
                    #Critical section?
                    artifacts[artifact] = ArtifactSpec(url, [ArtifactType(artifact.artifactType, True, set(['']))])
                    return

            logging.warning('Artifact %s not found in any url!', artifact)
开发者ID:jboss-eap,项目名称:maven-repository-builder,代码行数:9,代码来源:artifact_list_builder.py


示例11: test_listRepository_file_gatcvs

    def test_listRepository_file_gatcvs(self):
        config = configuration.Configuration()
        config.addClassifiers = "__all__"
        repoUrls = ['file://./tests/testrepo']
        gatcvs = [
            'bar:foo-bar:pom:1.1',
            'foo.baz:baz-core:jar:1.0'
        ]

        builder = artifact_list_builder.ArtifactListBuilder(config)
        actualArtifacts = builder._listRepository(repoUrls, None, gatcvs)
        expectedArtifacts = {
            MavenArtifact.createFromGAV(gatcvs[0]): ArtifactSpec(repoUrls[0], [ArtifactType("pom", True, set(['']))]),
            MavenArtifact.createFromGAV(gatcvs[1]): ArtifactSpec(repoUrls[0], [ArtifactType("pom", True, set([''])),
                                        ArtifactType("jar", True, set(['', 'javadoc', 'sources']))])
        }

        self.assertEqualArtifactList(expectedArtifacts, actualArtifacts)
开发者ID:fkujikis,项目名称:maven-repository-builder,代码行数:18,代码来源:tests.py


示例12: _getExpectedArtifacts

    def _getExpectedArtifacts(self, repoUrl, dependencies):

        artSpecDict = {}
        for dep in dependencies.keys():
            artifact = MavenArtifact.createFromGAV(dep)
            artTypes = []
            artTypes.append(ArtifactType(artifact.artifactType, artifact.artifactType != "pom", dependencies[dep]))
            artSpec = ArtifactSpec(repoUrl, artTypes)
            gav = artifact.getGAV()
            if gav in artSpecDict.keys():
                artSpecDict[gav].merge(artSpec)
            else:
                artSpecDict[gav] = artSpec
        expectedArtifacts = {}
        for (gav, artSpec) in artSpecDict.iteritems():
            artifact = MavenArtifact.createFromGAV(gav)
            expectedArtifacts[artifact] = artSpec

        return expectedArtifacts
开发者ID:fkujikis,项目名称:maven-repository-builder,代码行数:19,代码来源:tests.py


示例13: depListToArtifactList

def depListToArtifactList(depList):
    """Convert the maven GAV to a URL relative path"""
    regexComment = re.compile('#.*$')
    #regexLog = re.compile('^\[\w*\]')
    artifactList = []
    for nextLine in depList:
        nextLine = regexComment.sub('', nextLine)
        nextLine = nextLine.strip()
        gav = maven_repo_util.parseGATCVS(nextLine)
        if gav:
            artifactList.append(MavenArtifact.createFromGAV(gav))
    return artifactList
开发者ID:jboss-eap,项目名称:maven-repository-builder,代码行数:12,代码来源:artifact_downloader.py


示例14: _filterExcludedRepositories

    def _filterExcludedRepositories(self, artifactList):
        """
        Filter artifactList removing artifacts existing in specified repositories.

        :param artifactList: artifactList to be filtered.
        :returns: artifactList without artifacts that exists in specified repositories.
        """

        logging.debug("Filtering artifacts contained in excluded repositories.")

        pool = ThreadPool(maven_repo_util.MAX_THREADS)
        # Contains artifact to be removed
        delArtifacts = []
        for ga in artifactList.keys():
            groupId = ga.split(':')[0]
            artifactId = ga.split(':')[1]
            for priority in artifactList[ga].keys():
                for version in artifactList[ga][priority].keys():
                    artifact = MavenArtifact(groupId, artifactId, "pom", version)
                    pool.apply_async(
                        _artifactInRepos,
                        [self.config.excludedRepositories, artifact, priority, delArtifacts]
                    )

        # Close the pool and wait for the workers to finnish
        pool.close()
        pool.join()
        for artifact, priority in delArtifacts:
            ga = artifact.getGA()
            logging.debug("Dropping GAV %s:%s from priority %i because it was found in an excluded repository.",
                          ga, artifact.version, priority)
            del artifactList[ga][priority][artifact.version]
            if not artifactList[ga][priority]:
                logging.debug("Dropping GA %s from priority %i because of no version left.", ga, priority)
                del artifactList[ga][priority]
            if not artifactList[ga]:
                logging.debug("Dropping GA %s because of no priority left.", ga)
                del artifactList[ga]

        return artifactList
开发者ID:fkujikis,项目名称:maven-repository-builder,代码行数:40,代码来源:filter.py


示例15: generate_report

def generate_report(output, config, artifact_list, report_name):
    """
    Generates report. The report consists of a summary page, groupId pages, artifactId pages and leaf artifact pages.
    Summary page contains list of roots, list of BOMs, list of multi-version artifacts, links to all artifacts and list
    of artifacts that do not match the BOM version. Each artifact has a separate page containing paths from roots to
    the artifact with path explanation.
    """
    multiversion_gas = dict()
    malformed_versions = dict()
    if os.path.exists(output):
        logging.warn("Target report path %s exists. Deleting...", output)
        shutil.rmtree(output)
    os.makedirs(os.path.join(output, "pages"))

    roots = []
    for artifact_source in config.artifactSources:
        if artifact_source["type"] == "dependency-graph":
            roots.extend(artifact_source["top-level-gavs"])

    groupids = dict()
    version_pattern = re.compile("^.*[.-]redhat-[^.]+$")
    for ga in artifact_list:
        (groupid, artifactid) = ga.split(":")
        priority_list = artifact_list[ga]
        for priority in priority_list:
            versions = priority_list[priority]
            if versions:
                groupids.setdefault(groupid, dict()).setdefault(artifactid, dict()).update(versions)
                if len(groupids[groupid][artifactid]) > 1:
                    multiversion_gas.setdefault(groupid, dict())[artifactid] = groupids[groupid][artifactid]
                for version in versions:
                    if not version_pattern.match(version):
                        malformed_versions.setdefault(groupid, dict()).setdefault(artifactid, dict())[
                            version
                        ] = groupids[groupid][artifactid][version]

    optional_artifacts = dict()
    for groupid in groupids.keys():
        artifactids = groupids[groupid]
        for artifactid in artifactids.keys():
            versions = artifactids[artifactid]
            for version in versions.keys():
                art_spec = versions[version]

                ma = MavenArtifact.createFromGAV("%s:%s:%s" % (groupid, artifactid, version))
                generate_artifact_page(ma, roots, art_spec.paths, art_spec.url, output, groupids, optional_artifacts)
            generate_artifactid_page(groupid, artifactid, versions, output)
        generate_groupid_page(groupid, artifactids, output)
    generate_summary(config, groupids, multiversion_gas, malformed_versions, output, report_name, optional_artifacts)
    generate_css(output)
开发者ID:pkocandr,项目名称:maven-repository-builder,代码行数:50,代码来源:reporter.py


示例16: depListToArtifactList

def depListToArtifactList(depList):
    """Convert the maven GAV to a URL relative path"""
    regexComment = re.compile('#.*$')
    #regexLog = re.compile('^\[\w*\]')
    # Match pattern groupId:artifactId:type:[classifier:]version[:scope]
    regexGAV = re.compile('(([\w\-.]+:){3}([\w\-.]+:)?([\d][\w\-.]+))(:[\w]*\S)?')
    artifactList = []
    for nextLine in depList:
        nextLine = regexComment.sub('', nextLine)
        nextLine = nextLine.strip()
        gav = regexGAV.search(nextLine)
        if gav:
            artifactList.append(MavenArtifact.createFromGAV(gav.group(1)))
    return artifactList
开发者ID:janinko,项目名称:maven-repository-builder,代码行数:14,代码来源:maven_repo_builder.py


示例17: _filterExcludedRepositories

    def _filterExcludedRepositories(self, artifactList):
        """
        Filter artifactList removing artifacts existing in specified repositories.

        :param artifactList: artifactList to be filtered.
        :returns: artifactList without arifacts that exists in specified repositories.
        """

        logging.debug("Filtering artifacts contained in excluded repositories.")

        pool = ThreadPool(maven_repo_util.MAX_THREADS)
        # Contains artifact to be removed
        delArtifacts = []
        for gat in artifactList.keys():
            groupId = gat.split(':')[0]
            artifactId = gat.split(':')[1]
            artifactType = gat.split(':')[2]
            for priority in artifactList[gat].keys():
                for version in artifactList[gat][priority].keys():
                    artifact = MavenArtifact(groupId, artifactId, artifactType, version)
                    pool.apply_async(
                        _artifactInRepos,
                        [self.config.excludedRepositories, artifact, priority, delArtifacts]
                    )
                if not artifactList[gat][priority]:
                    del artifactList[gat][priority]
            if not artifactList[gat]:
                del artifactList[gat]

        # Close the pool and wait for the workers to finnish
        pool.close()
        pool.join()
        for artifact, priority in delArtifacts:
            del artifactList[artifact.getGAT()][priority][artifact.version]

        return artifactList
开发者ID:VaclavDedik,项目名称:maven-repository-builder,代码行数:36,代码来源:filter.py


示例18: _listDependencies

    def _listDependencies(self, repoUrls, gavs):
        """
        Loads maven artifacts from mvn dependency:list.

        :param repoUrls: URL of the repositories that contains the listed artifacts
        :param gavs: List of top level GAVs
        :returns: Dictionary where index is MavenArtifact object and value is
                  it's repo root URL, or empty dictionary if something goes wrong.
        """
        artifacts = {}

        for gav in gavs:
            artifact = MavenArtifact.createFromGAV(gav)

            pomDir = 'poms'
            fetched = False
            for repoUrl in repoUrls:
                pomUrl = repoUrl + '/' + artifact.getPomFilepath()
                if fetchArtifact(pomUrl, pomDir):
                    fetched = True
                    break

            if not fetched:
                logging.warning("Failed to retrieve pom file for artifact %s",
                                gav)
                continue

            # Build dependency:list
            mvnOutDir = "maven"
            if not os.path.isdir(mvnOutDir):
                os.makedirs(mvnOutDir)
            mvnOutFilename = mvnOutDir + "/" + artifact.getBaseFilename() + "-maven.out"
            with open(mvnOutFilename, "w") as mvnOutputFile:
                retCode = call(['mvn', 'dependency:list', '-N', '-f',
                                pomDir + '/' + artifact.getPomFilename()], stdout=mvnOutputFile)

                if retCode != 0:
                    logging.warning("Maven failed to finish with success. Skipping artifact %s",
                                    gav)
                    continue

            # Parse GAVs from maven output
            gavList = self._parseDepList(mvnOutFilename)

            artifacts.update(self._listArtifacts(repoUrls, gavList))

        return artifacts
开发者ID:pgier,项目名称:maven-repository-builder,代码行数:47,代码来源:artifact_list_builder.py


示例19: test_listMeadTagArtifacts

    def test_listMeadTagArtifacts(self):
        config = configuration.Configuration()
        config.allClassifiers = True
        kojiUrl = "http://brewhub.devel.redhat.com/brewhub/"
        tagName = "mead-import-maven"
        downloadRootUrl = "http://download.devel.redhat.com/brewroot/packages/"
        gavPatterns = [
            'org.apache.maven:maven-core:2.0.6'
        ]

        builder = artifact_list_builder.ArtifactListBuilder(config)
        actualArtifacts = builder._listMeadTagArtifacts(kojiUrl, downloadRootUrl, tagName, gavPatterns)
        expectedUrl = downloadRootUrl + "org.apache.maven-maven-core/2.0.6/1/maven/"
        expectedArtifacts = {
            MavenArtifact.createFromGAV(gavPatterns[0]): ArtifactSpec(expectedUrl, set(['javadoc', 'sources']))
        }

        self.assertEqualArtifactList(expectedArtifacts, actualArtifacts)
开发者ID:jdcasey,项目名称:maven-repository-builder,代码行数:18,代码来源:tests.py


示例20: _listDependencyGraph

    def _listDependencyGraph(self, aproxUrl, wsid, sourceKey, gavs):
        """
        Loads maven artifacts from dependency graph.

        :param aproxUrl: URL of the AProx instance
        :param gavs: List of top level GAVs
        :param wsid: workspace ID
        :returns: Dictionary where index is MavenArtifact object and value is
                  ArtifactSpec with its repo root URL
        """
        from aprox_apis import AproxApi10
        aprox = AproxApi10(aproxUrl)

        deleteWS = False

        if not wsid:
            # Create workspace
            ws = aprox.createWorkspace()
            wsid = ws["id"]
            deleteWS = True

        # Resolve graph MANIFEST for GAVs
        urlmap = aprox.urlmap(wsid, sourceKey, gavs, self.configuration.allClassifiers)

        # parse returned map
        artifacts = {}
        for gav in urlmap:
            artifact = MavenArtifact.createFromGAV(gav)
            groupId = artifact.groupId
            artifactId = artifact.artifactId
            version = artifact.version

            filenames = urlmap[gav]["files"]
            url = urlmap[gav]["repoUrl"]

            (extsAndClass, suffix) = self._getExtensionsAndClassifiers(artifactId, version, filenames)

            self._addArtifact(artifacts, groupId, artifactId, version, extsAndClass, suffix, url)

        # cleanup
        if deleteWS:
            aprox.deleteWorkspace(wsid)

        return artifacts
开发者ID:wfkbuilder,项目名称:maven-repository-builder,代码行数:44,代码来源:artifact_list_builder.py



注:本文中的maven_artifact.MavenArtifact类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mavros.get_topic函数代码示例发布时间:2022-05-27
下一篇:
Python matutil.rowdict2mat函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap