org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories Java Examples
The following examples show how to use
org.jboss.shrinkwrap.resolver.api.maven.repository.MavenRemoteRepositories.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Main.java From thorntail with Apache License 2.0 | 6 votes |
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)) .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("redhat-ga", "https://maven.repository.redhat.com/ga/", "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); }
Example #2
Source File: AbstractArchiveProvider.java From krazo with Apache License 2.0 | 5 votes |
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); }
Example #3
Source File: MicroOuterDeployer.java From piranha with BSD 3-Clause "New" or "Revised" License | 5 votes |
private MavenRemoteRepository createRepo(String repoUrl) { MavenRemoteRepository repo = MavenRemoteRepositories.createRemoteRepository( UUID.randomUUID().toString(), repoUrl, "default"); repo.setUpdatePolicy(UPDATE_POLICY_NEVER); return repo; }
Example #4
Source File: AbstractArchiveProvider.java From ozark with Apache License 2.0 | 5 votes |
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); }
Example #5
Source File: Main.java From wildfly-swarm with Apache License 2.0 | 5 votes |
private static ArtifactResolvingHelper getResolvingHelper(final List<String> repos) { final ConfigurableMavenResolverSystem resolver = Maven.configureResolver() .withMavenCentralRepo(true) .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("jboss-public-repository-group", "http://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); }
Example #6
Source File: PackageTest.java From jqm with Apache License 2.0 | 5 votes |
@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(); }
Example #7
Source File: ShrinkwrapArtifactResolvingHelper.java From thorntail with Apache License 2.0 | 4 votes |
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/", MAVEN_LAYOUT_DEFAULT); jbossPublic.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE); jbossPublic.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER); MavenRemoteRepository redhatGa = MavenRemoteRepositories.createRemoteRepository("redhat-ga", "https://maven.repository.redhat.com/ga/", MAVEN_LAYOUT_DEFAULT); redhatGa.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE); redhatGa.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER); MavenRemoteRepository gradleTools = MavenRemoteRepositories.createRemoteRepository("gradle", "https://repo.gradle.org/gradle/libs-releases-local", MAVEN_LAYOUT_DEFAULT); gradleTools.setChecksumPolicy(MavenChecksumPolicy.CHECKSUM_POLICY_IGNORE); gradleTools.setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER); Boolean offline = Boolean.valueOf(System.getProperty("thorntail.resolver.offline", "false")); final ConfigurableMavenResolverSystem resolver = Maven.configureResolver() .withMavenCentralRepo(true) .withRemoteRepo(jbossPublic) .withRemoteRepo(redhatGa) .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, MAVEN_LAYOUT_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; }); }
Example #8
Source File: Build.java From ARCHIVE-wildfly-swarm with Apache License 2.0 | 4 votes |
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)); }
Example #9
Source File: LibraryResolverMaven.java From jqm with Apache License 2.0 | 4 votes |
ConfigurableMavenResolverSystem getMavenResolver() { // Retrieve resolver configuration if (REPO_LIST == null) { REPO_LIST = new ArrayList<>(5); for (String gp : mavenRepos) { REPO_LIST.add(gp); } MAVEN_SETTINGS_CL = mavenSettingsClPath; MAVEN_SETTINGS_FILE = mavenSettingsFilePath; } // Resolver ConfigurableMavenResolverSystem resolver = Maven.configureResolver(); // settings.xml? if (MAVEN_SETTINGS_CL != null && MAVEN_SETTINGS_FILE == null) { jqmlogger.trace("Custom settings file from class-path will be used: " + MAVEN_SETTINGS_CL); resolver.fromClassloaderResource(MAVEN_SETTINGS_CL); } if (MAVEN_SETTINGS_FILE != null) { jqmlogger.trace("Custom settings file from file system will be used: " + MAVEN_SETTINGS_FILE); resolver.fromFile(MAVEN_SETTINGS_FILE); } // Repositories to use. boolean withCentral = false; for (String repo : REPO_LIST) { if (repo.contains("repo1.maven.org")) { withCentral = true; jqmlogger.trace("Using Maven central as a Maven repository"); continue; } jqmlogger.trace("Using Maven repository {}", repo); resolver = resolver .withRemoteRepo(MavenRemoteRepositories.createRemoteRepository("repo" + Math.abs(repo.hashCode()), repo, "default") .setUpdatePolicy(MavenUpdatePolicy.UPDATE_POLICY_NEVER)); } resolver.withMavenCentralRepo(withCentral); return resolver; }