• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MavenRemoteRepositories类的典型用法和代码示例

java 3次浏览

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

MavenRemoteRepositories类属于org.jboss.shrinkwrap.resolver.api.maven.repository包,在下文中一共展示了MavenRemoteRepositories类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: process

点赞 3

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
public static void process(File input, File output, Artifact artifact, String ftpUrl, String user, String pass, String remotebase, FTPType type)
        throws IOException, JAXBException {
    artifactslist = Lists.newArrayList();
    mvnremote = MavenRemoteRepositories.createRemoteRepository("UserRemoteRepo", artifact.getRepo().getUrl(), "default").setUpdatePolicy(
            MavenUpdatePolicy.UPDATE_POLICY_NEVER);
    System.out.println("using repo: " + mvnremote.getUrl());
    System.out.println();
    String xml = getIndex(artifact);
    System.out.println(xml);
    Metadata md = parsemavenmeta(xml);
    debugmeta(md);
    getAllVersionPoms(md, artifact);
    System.out.println("generating page");
    WebHandler.createWebpage(input, output, artifact.getArtifactId(), artifactslist, artifact.getArtifactId());
    System.out.println("uploading if needed");
    if (Cmd.getInstance().url != null) {
        upload(output, ftpUrl, user, pass,
               remotebase + artifact.getGroupId().replace(".", "/") + "/" + artifact.getArtifactId().replace(".", "/") + "/index.html", type);
    }
    if (Cmd.getInstance().localLoc != null && !Cmd.getInstance().localLoc.isEmpty()) {
        copy(output, Cmd.getInstance().localLoc + "/" +
                     artifact.getGroupId().replace(".", "/") + "/" + artifact.getArtifactId().replace(".", "/") + "/index.html");

    }
}
 

开发者ID:SpongePowered,
项目名称:repoindexer,
代码行数:26,
代码来源:EntryPoint.java

示例2: AbstractArchiveProvider

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
public AbstractArchiveProvider() {

        sonatypeRepo = MavenRemoteRepositories.createRemoteRepository(
            "sonatype-oss-snapshots",
            "https://oss.sonatype.org/content/repositories/snapshots",
            "default"
        );

        // prevent weird errors logged during test execution
        sonatypeRepo.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_ALWAYS);

    }
 

开发者ID:mvc-spec,
项目名称:ozark,
代码行数:13,
代码来源:AbstractArchiveProvider.java

示例3: getResolvingHelper

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
private static ArtifactResolvingHelper getResolvingHelper(final List<String> repos) {
    final ConfigurableMavenResolverSystem resolver = Maven.configureResolver()
            .withMavenCentralRepo(true)
            .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("jboss-public-repository-group",
                                                                           "https://repository.jboss.org/nexus/content/groups/public/",
                                                                           "default")
                                    .setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE)
                                    .setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER));

    repos.forEach(r -> resolver.withRemoteRepo(MavenRemoteRepositories.createRemoteRepository(r, r, "default")
                                                       .setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE)
                                                       .setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER)));

    return new ShrinkwrapArtifactResolvingHelper(resolver);
}
 

开发者ID:wildfly-swarm,
项目名称:wildfly-swarm,
代码行数:16,
代码来源:Main.java

示例4: testFailingDependency

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
@Test(expected = NoResolvedResultException.class)
public void testFailingDependency() throws Exception
{
    jqmlogger.debug("**********************************************************");
    jqmlogger.debug("Starting test testFailingDependency");

    SLF4JBridgeHandler.install();

    Maven.configureResolver()
            .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("marsu", "http://marsupilami.com", "default"))
            .withMavenCentralRepo(false).resolve("com.enioka.jqm:marsu:1.1.4").withTransitivity().asFile();
}
 

开发者ID:enioka,
项目名称:jqm,
代码行数:13,
代码来源:PackageTest.java

示例5: defaultInstance

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
public static ShrinkwrapArtifactResolvingHelper defaultInstance() {
    return INSTANCE.updateAndGet(e -> {
        if (e != null) {
            return e;
        }

        MavenRemoteRepository jbossPublic =
                MavenRemoteRepositories.createRemoteRepository("jboss-public-repository-group",
                                                               "https://repository.jboss.org/nexus/content/groups/public/",
                                                               "default");
        jbossPublic.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE);
        jbossPublic.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER);


        MavenRemoteRepository gradleTools =
                MavenRemoteRepositories.createRemoteRepository("gradle",
                                                               "http://repo.gradle.org/gradle/libs-releases-local",
                                                               "default");
        gradleTools.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE);
        gradleTools.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER);

        Boolean offline = Boolean.valueOf(System.getProperty("swarm.resolver.offline", "false"));
        final ConfigurableMavenResolverSystem resolver = Maven.configureResolver()
                .withMavenCentralRepo(true)
                .withRemoteRepo(jbossPublic)
                .withRemoteRepo(gradleTools)
                .workOffline(offline);

        final String additionalRepos = System.getProperty(SwarmInternalProperties.BUILD_REPOS);
        if (additionalRepos != null) {
            Arrays.asList(additionalRepos.split(","))
                    .forEach(r -> {
                        MavenRemoteRepository repo =
                                MavenRemoteRepositories.createRemoteRepository(r, r, "default");
                        repo.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE);
                        repo.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER);
                        resolver.withRemoteRepo(repo);
                    });
        }


        ShrinkwrapArtifactResolvingHelper helper = new ShrinkwrapArtifactResolvingHelper(resolver);
        helper.session().setCache(new SimpleRepositoryCache());
        helper.session().setUpdatePolicy(RepositoryPolicy.UPDATE_POLICY_DAILY);
        helper.session().setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);

        return helper;
    });
}
 

开发者ID:wildfly-swarm,
项目名称:wildfly-swarm,
代码行数:50,
代码来源:ShrinkwrapArtifactResolvingHelper.java

示例6: run

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
public File run() throws Exception {
    final String[] parts = this.source.getName().split("\\.(?=[^\\.]+$)");
    final String baseName = parts[0];
    final String type = parts[1] == null ? "jar" : parts[1];
    final MavenRemoteRepository jbossPublic =
            MavenRemoteRepositories.createRemoteRepository("jboss-public-repository-group",
                    "http://repository.jboss.org/nexus/content/groups/public/",
                    "default");
    jbossPublic.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE);
    jbossPublic.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER);

    final ConfigurableMavenResolverSystem resolver = Maven.configureResolver()
            .withMavenCentralRepo(true)
            .withRemoteRepo(jbossPublic);

    final BuildTool tool = new BuildTool()
            .artifactResolvingHelper(new ShrinkwrapArtifactResolvingHelper(resolver))
            .projectArtifact("", baseName, "", type, this.source)
            .resolveTransitiveDependencies(true)
            .properties(this.properties);

    if (this.autoDetectFractions) {
        this.swarmDependencies.addAll(new PackageAnalyzer(this.source).detectNeededFractions());
    } else {
        System.err.println("Skipping fraction auto-detection");
    }

    for (String dep : this.swarmDependencies) {
        tool.dependency("compile", "org.wildfly.swarm", dep, this.version, "jar", null, null, true);
    }

    final String jarName = this.name != null ? this.name : baseName;
    final String outDir = this.outputDir.getCanonicalPath();
    System.err.println(String.format("Building %s/%s-swarm.jar with fractions: %s",
            outDir,
            jarName,
            String.join(", ",
                    allRequiredFractions()
                            .stream()
                            .sorted()
                            .collect(Collectors.toList()))));

    return tool.build(jarName, Paths.get(outDir));
}
 

开发者ID:wildfly-swarm-archive,
项目名称:ARCHIVE-wildfly-swarm,
代码行数:45,
代码来源:Build.java

示例7: getMavenResolver

点赞 2

import org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories; //导入依赖的package包/类
static ConfigurableMavenResolverSystem getMavenResolver(DbConn cnx)
{
    // Retrieve resolver configuration
    if (REPO_LIST == null)
    {
        List<GlobalParameter> repolist = GlobalParameter.select(cnx, "globalprm_select_by_key", "mavenRepo");
        REPO_LIST = new ArrayList<String>(repolist.size());
        for (GlobalParameter gp : repolist)
        {
            REPO_LIST.add(gp.getValue());
        }

        MAVEN_SETTINGS_CL = GlobalParameter.getParameter(cnx, "mavenSettingsCL", null);
        MAVEN_SETTINGS_FILE = GlobalParameter.getParameter(cnx, "mavenSettingsFile", null);
    }

    boolean withCentral = false;
    String withCustomSettings = null;
    String withCustomSettingsFile = null;
    if (MAVEN_SETTINGS_CL != null && MAVEN_SETTINGS_FILE == null)
    {
        jqmlogger.trace("Custom settings file will be used: " + MAVEN_SETTINGS_CL);
        withCustomSettings = MAVEN_SETTINGS_CL;
    }
    if (MAVEN_SETTINGS_FILE != null)
    {
        jqmlogger.trace("Custom settings file will be used: " + MAVEN_SETTINGS_FILE);
        withCustomSettingsFile = MAVEN_SETTINGS_FILE;
    }

    // Configure resolver
    ConfigurableMavenResolverSystem resolver = Maven.configureResolver();
    if (withCustomSettings != null && withCustomSettingsFile == null)
    {
        resolver.fromClassloaderResource(withCustomSettings);
    }
    if (withCustomSettingsFile != null)
    {
        resolver.fromFile(withCustomSettingsFile);
    }

    for (String repo : REPO_LIST)
    {
        if (repo.contains("repo1.maven.org"))
        {
            withCentral = true;
        }
        resolver = resolver.withRemoteRepo(MavenRemoteRepositories.createRemoteRepository(repo, repo, "default")
                .setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER));
    }
    resolver.withMavenCentralRepo(withCentral);
    return resolver;
}
 

开发者ID:enioka,
项目名称:jqm,
代码行数:54,
代码来源:LibraryResolverMaven.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)