org.jboss.shrinkwrap.resolver.api.maven.repository.MavenChecksumPolicy Java Examples
The following examples show how to use
org.jboss.shrinkwrap.resolver.api.maven.repository.MavenChecksumPolicy.
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: 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 #3
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 #4
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)); }