本文整理汇总了Java中org.eclipse.aether.graph.Exclusion类的典型用法代码示例。如果您正苦于以下问题:Java Exclusion类的具体用法?Java Exclusion怎么用?Java Exclusion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Exclusion类属于org.eclipse.aether.graph包,在下文中一共展示了Exclusion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDependencyManagement
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
public void addDependencyManagement(DependencyManagement dependencyManagement) {
for (org.springframework.boot.cli.compiler.dependencies.Dependency dependency : dependencyManagement
.getDependencies()) {
List<Exclusion> aetherExclusions = new ArrayList<Exclusion>();
for (org.springframework.boot.cli.compiler.dependencies.Dependency.Exclusion exclusion : dependency
.getExclusions()) {
aetherExclusions.add(new Exclusion(exclusion.getGroupId(),
exclusion.getArtifactId(), "*", "*"));
}
Dependency aetherDependency = new Dependency(
new DefaultArtifact(dependency.getGroupId(),
dependency.getArtifactId(), "jar", dependency.getVersion()),
JavaScopes.COMPILE, false, aetherExclusions);
this.managedDependencies.add(0, aetherDependency);
this.managedDependencyByGroupAndArtifact.put(getIdentifier(aetherDependency),
aetherDependency);
}
this.dependencyManagement = this.dependencyManagement == null
? dependencyManagement
: new CompositeDependencyManagement(dependencyManagement,
this.dependencyManagement);
this.artifactCoordinatesResolver = new DependencyManagementArtifactCoordinatesResolver(
this.dependencyManagement);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:25,代码来源:DependencyResolutionContext.java
示例2: resolve
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
@Override
public URI[] resolve(Map args, List depsInfo, Map... dependencyMaps) {
List<Exclusion> exclusions = createExclusions(args);
List<Dependency> dependencies = createDependencies(dependencyMaps, exclusions);
try {
List<File> files = resolve(dependencies);
List<URI> uris = new ArrayList<URI>(files.size());
for (File file : files) {
uris.add(file.toURI());
}
return uris.toArray(new URI[uris.size()]);
}
catch (Exception ex) {
throw new DependencyResolutionFailedException(ex);
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:AetherGrapeEngine.java
示例3: mavenDependencyToDependency
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private Dependency mavenDependencyToDependency(
org.apache.maven.model.Dependency dep) {
Artifact art = new DefaultArtifact(dep.getGroupId(),
dep.getArtifactId(),
dep.getClassifier(),
dep.getType(),
dep.getVersion());
Collection<Exclusion> excls = new HashSet<Exclusion>();
for (org.apache.maven.model.Exclusion excl :
dep.getExclusions()) {
excls.add(mavenExclusionToExclusion(excl));
}
return new Dependency(art,
dep.getScope(),
new Boolean(dep.isOptional()),
excls);
}
示例4: isExcludedFromParent
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private boolean isExcludedFromParent(Dependency dependency) {
boolean result = false;
if (parent != null && parent.getExclusions().size() > 0) {
for (Exclusion exclusion : parent.getExclusions()) {
if (exclusion != null) {
if (exclusion.getArtifactId() != null
&& exclusion.getArtifactId().equals(dependency.getArtifact().getArtifactId())) {
if (exclusion.getGroupId() != null
&& exclusion.getGroupId().equals(dependency.getArtifact().getGroupId())) {
result = true;
break;
}
}
}
}
}
return result;
}
示例5: isExcludedFromParent
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private boolean isExcludedFromParent(Dependency dependency)
{
boolean result = false;
if (parent != null && parent.getExclusions().size() > 0)
{
for (Exclusion exclusion : parent.getExclusions())
{
if (exclusion != null)
{
if (exclusion.getArtifactId() != null
&& exclusion.getArtifactId().equals(dependency.getArtifact().getArtifactId()))
{
if (exclusion.getGroupId() != null
&& exclusion.getGroupId().equals(dependency.getArtifact().getGroupId()))
{
result = true;
break;
}
}
}
}
}
return result;
}
示例6: getDeployDependencies
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private List<Artifact> getDeployDependencies(Artifact artifact, List<Exclusion> exclusions, boolean testScope, Map<String, String> properties) {
ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
descriptorRequest.setRepositories(AetherUtil.newRepositories(deployConfig));
descriptorRequest.setArtifact(artifact);
Model model = AetherUtil.readPom(artifact);
if (model == null) {
throw new IllegalStateException("Unable to read POM for " + artifact.getFile());
}
try {
ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor(session, descriptorRequest);
return descriptorResult.getDependencies().stream()
.filter(d -> "compile".equalsIgnoreCase(d.getScope()) || ("test".equalsIgnoreCase(d.getScope()) && testScope))
.filter(d -> !exclusions.contains(new Exclusion(d.getArtifact().getGroupId(), d.getArtifact().getArtifactId(), null, null)))
.map(Dependency::getArtifact)
.map(d -> this.checkWithModel(model, d, properties))
.collect(Collectors.toList());
} catch (ArtifactDescriptorException e) {
LOG.error("Unable to resolve dependencies for deploy artifact '{}', unable to auto-discover ", artifact, e);
}
return Collections.emptyList();
}
示例7: toDependency
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
public static Dependency toDependency(org.apache.maven.artifact.Artifact artifact, Collection<org.apache.maven.model.Exclusion> exclusions) {
if (artifact == null) {
return null;
}
Artifact result = toArtifact(artifact);
List<Exclusion> excl = null;
if (exclusions != null) {
excl = new ArrayList<Exclusion>(exclusions.size());
for (org.apache.maven.model.Exclusion exclusion : exclusions) {
excl.add(toExclusion(exclusion));
}
}
return new Dependency(result, artifact.getScope(), artifact.isOptional(), excl);
}
示例8: createExclusions
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<Exclusion> createExclusions(Map<?, ?> args) {
List<Exclusion> exclusions = new ArrayList<Exclusion>();
if (args != null) {
List<Map<String, Object>> exclusionMaps = (List<Map<String, Object>>) args
.get("excludes");
if (exclusionMaps != null) {
for (Map<String, Object> exclusionMap : exclusionMaps) {
exclusions.add(createExclusion(exclusionMap));
}
}
}
return exclusions;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:AetherGrapeEngine.java
示例9: createDependencies
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private List<Dependency> createDependencies(Map<?, ?>[] dependencyMaps,
List<Exclusion> exclusions) {
List<Dependency> dependencies = new ArrayList<Dependency>(dependencyMaps.length);
for (Map<?, ?> dependencyMap : dependencyMaps) {
dependencies.add(createDependency(dependencyMap, exclusions));
}
return dependencies;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:AetherGrapeEngine.java
示例10: createDependency
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private Dependency createDependency(Map<?, ?> dependencyMap,
List<Exclusion> exclusions) {
Artifact artifact = createArtifact(dependencyMap);
if (isTransitive(dependencyMap)) {
return new Dependency(artifact, JavaScopes.COMPILE, false, exclusions);
}
return new Dependency(artifact, JavaScopes.COMPILE, null, WILDCARD_EXCLUSION);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:AetherGrapeEngine.java
示例11: createDependency
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
public Dependency createDependency(){
Dependency dependency=new Dependency(createArtifact(),getScope());
dependency.setOptional(getOptional());
List<Exclusion> exclusions=new ArrayList<Exclusion>();
for (ExclusionConfig c : getExclusions()){
exclusions.add(c.createExclusion());
}
dependency.setExclusions(exclusions);
return dependency;
}
示例12: mavenExclusionToExclusion
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private Exclusion mavenExclusionToExclusion(
org.apache.maven.model.Exclusion excl) {
return new Exclusion(excl.getGroupId(),
excl.getArtifactId(),
null,
null);
}
示例13: emitArtifactBody
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private void emitArtifactBody(Artifact art, Collection<Dependency> deps,
JsonGenerator gen) {
gen.write("artifactId", art.getArtifactId());
gen.write("groupId", art.getGroupId());
gen.write("version", art.getVersion());
gen.write("classifier", art.getClassifier());
gen.write("extension", art.getExtension());
if (deps != null) {
gen.writeStartArray("dependencies");
for (Dependency dep : deps) {
gen.writeStartObject();
emitArtifactBody(dep.getArtifact(), null, gen);
gen.write("scope", dep.getScope());
gen.write("optional", dep.isOptional());
gen.writeStartArray("exclusions");
for (Exclusion excl : dep.getExclusions()) {
gen.writeStartObject();
gen.write("artifactId",
excl.getArtifactId());
gen.write("classifier",
excl.getClassifier());
gen.write("extension",
excl.getExtension());
gen.write("groupId",
excl.getGroupId());
gen.writeEnd();
}
gen.writeEnd();
gen.writeEnd();
}
gen.writeEnd();
}
}
示例14: getExclusions
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private List<Exclusion> getExclusions(String exclusionString) {
if (exclusionString == null || exclusionString.isEmpty()) {
return Collections.emptyList();
}
return Stream.of(exclusionString.split(";"))
.map(this::toExclusion)
.collect(Collectors.toList());
}
示例15: createExclusion
import org.eclipse.aether.graph.Exclusion; //导入依赖的package包/类
private Exclusion createExclusion(Map<String, Object> exclusionMap) {
String group = (String) exclusionMap.get("group");
String module = (String) exclusionMap.get("module");
return new Exclusion(group, module, "*", "*");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:AetherGrapeEngine.java