本文整理汇总了Java中org.apache.maven.model.Exclusion类的典型用法代码示例。如果您正苦于以下问题:Java Exclusion类的具体用法?Java Exclusion怎么用?Java Exclusion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Exclusion类属于org.apache.maven.model包,在下文中一共展示了Exclusion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getExclusions
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private List<Exclusion> getExclusions(ModuleDependency dependency, Set<Configuration> configurations) {
if (!dependency.isTransitive()) {
return EXCLUDE_ALL;
}
List<Exclusion> mavenExclusions = new ArrayList<Exclusion>();
Set<ExcludeRule> excludeRules = new HashSet<ExcludeRule>(dependency.getExcludeRules());
for (Configuration configuration : configurations) {
excludeRules.addAll(configuration.getExcludeRules());
}
for (ExcludeRule excludeRule : excludeRules) {
Exclusion mavenExclusion = (Exclusion) excludeRuleConverter.convert(excludeRule);
if (mavenExclusion != null) {
mavenExclusions.add(mavenExclusion);
}
}
return mavenExclusions;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:DefaultPomDependenciesConverter.java
示例2: addDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier) {
Dependency mavenDependency = new Dependency();
mavenDependency.setGroupId(dependency.getGroupId());
mavenDependency.setArtifactId(artifactId);
mavenDependency.setVersion(mapToMavenSyntax(dependency.getVersion()));
mavenDependency.setType(type);
mavenDependency.setScope(scope);
mavenDependency.setClassifier(classifier);
for (ExcludeRule excludeRule : dependency.getExcludeRules()) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*"));
exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*"));
mavenDependency.addExclusion(exclusion);
}
getModel().addDependency(mavenDependency);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:MavenPomFileGenerator.java
示例3: should_create_dependency_from_gav_with_exclusions
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
@Test
public void should_create_dependency_from_gav_with_exclusions() {
// when
Dependency dependency =
MavenCoordinatesResolver.createDependencyFromCoordinates(String.join(":", groupId, artifactId, version),
true);
// then
assertThat(dependency)
.hasGroupId(groupId)
.hasArtifactId(artifactId)
.hasVersion(version)
.hasType("jar")
.hasClassifier(null)
.exclusions().hasSize(1);
Exclusion exclusion = dependency.getExclusions().get(0);
Assertions.assertThat(exclusion.getGroupId()).isEqualTo("*");
Assertions.assertThat(exclusion.getArtifactId()).isEqualTo("*");
}
开发者ID:arquillian,项目名称:smart-testing,代码行数:20,代码来源:MavenCoordinatesResolverTest.java
示例4: setExcludes
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
public void setExcludes(String exclusions) {
if (exclusions == null) {
return;
}
setExclusions(
Stream.of(exclusions.split(","))
.map(String::trim)
.map(exclusion -> {
String[] parts = exclusion.split(":");
Exclusion result = new Exclusion();
result.setGroupId(parts[0]);
if (parts.length == 2) {
result.setArtifactId(parts[1]);
}
return result;
})
.collect(Collectors.toList())
);
}
开发者ID:bsideup,项目名称:gradle-maven-sync-plugin,代码行数:24,代码来源:GradleStepdefs.java
示例5: resolve
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
protected Dependency resolve(Dependency rawDep) {
Dependency dep = new Dependency();
dep.setGroupId(substituteProperties(rawDep.getGroupId()));
dep.setArtifactId(substituteProperties(rawDep.getArtifactId()));
dep.setVersion(substituteProperties(rawDep.getVersion()));
dep.setScope(substituteProperties(rawDep.getScope()));
dep.setSystemPath(substituteProperties(rawDep.getSystemPath()));
dep.setClassifier(substituteProperties(rawDep.getClassifier()));
dep.setType(substituteProperties(rawDep.getType()));
dep.setOptional(substituteProperties(rawDep.getOptional()));
if (rawDep.getExclusions() != null) {
List<Exclusion> exclusions = new ArrayList<>(rawDep.getExclusions().size());
for (Exclusion rawEx : rawDep.getExclusions()) {
Exclusion ex = new Exclusion();
ex.setArtifactId(substituteProperties(rawEx.getArtifactId()));
ex.setGroupId(substituteProperties(rawEx.getGroupId()));
exclusions.add(ex);
}
dep.setExclusions(exclusions);
}
return dep;
}
开发者ID:uklance,项目名称:gradle-maven-share,代码行数:24,代码来源:ResolvedPom.java
示例6: visitBuildPluginDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitBuildPluginDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitBuildPluginDependencyExclusion( exclusion );
exclusion = visitor.replaceBuildPluginDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例7: visitBuildPluginManagementPluginDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitBuildPluginManagementPluginDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitBuildPluginManagementPluginDependencyExclusion( exclusion );
exclusion = visitor.replaceBuildPluginManagementPluginDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例8: visitDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitDependencyExclusion( exclusion );
exclusion = visitor.replaceDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例9: visitDependencyManagementDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitDependencyManagementDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitDependencyManagementDependencyExclusion( exclusion );
exclusion = visitor.replaceDependencyManagementDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例10: visitProfileBuildPluginDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitProfileBuildPluginDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitProfileBuildPluginDependencyExclusion( exclusion );
exclusion = visitor.replaceProfileBuildPluginDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例11: visitProfileBuildPluginManagementPluginDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitProfileBuildPluginManagementPluginDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitProfileBuildPluginManagementPluginDependencyExclusion( exclusion );
exclusion = visitor.replaceProfileBuildPluginManagementPluginDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例12: visitProfileDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitProfileDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitProfileDependencyExclusion( exclusion );
exclusion = visitor.replaceProfileDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例13: visitProfileDependencyManagementDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void visitProfileDependencyManagementDependency( ModelVisitor visitor, Dependency dependency )
{
List<Exclusion> exclusions = dependency.getExclusions();
if ( exclusions != null )
{
ListIterator<Exclusion> exclusionIterator = exclusions.listIterator();
while ( exclusionIterator.hasNext() )
{
Exclusion exclusion = exclusionIterator.next();
visitor.visitProfileDependencyManagementDependencyExclusion( exclusion );
exclusion = visitor.replaceProfileDependencyManagementDependencyExclusion( exclusion );
if ( exclusion == null )
exclusionIterator.remove();
else
exclusionIterator.set( exclusion );
}
}
}
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java
示例14: addDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier) {
Dependency mavenDependency = new Dependency();
mavenDependency.setGroupId(dependency.getGroupId());
mavenDependency.setArtifactId(artifactId);
mavenDependency.setVersion(dependency.getVersion());
mavenDependency.setType(type);
mavenDependency.setScope(scope);
mavenDependency.setClassifier(classifier);
for (ExcludeRule excludeRule : dependency.getExcludeRules()) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*"));
exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*"));
mavenDependency.addExclusion(exclusion);
}
getModel().addDependency(mavenDependency);
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:19,代码来源:MavenPomFileGenerator.java
示例15: toMavenDependency
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private Dependency toMavenDependency(org.eclipse.aether.graph.Dependency from) {
org.eclipse.aether.artifact.Artifact fromArt = from.getArtifact();
Dependency dependency = new Dependency();
dependency.setGroupId(fromArt.getGroupId());
dependency.setArtifactId(fromArt.getArtifactId());
dependency.setVersion(fromArt.getVersion());
dependency.setType(fromArt.getExtension());
dependency.setScope(Artifact.SCOPE_COMPILE.equals(from.getScope()) ? null : from.getScope());
dependency.setClassifier(fromArt.getClassifier());
dependency.setOptional(dependency.isOptional());
if (from.getExclusions() != null && from.getExclusions().size() > 0) {
List<Exclusion> exclusions = new LinkedList<Exclusion>();
for (org.eclipse.aether.graph.Exclusion fromEx : from.getExclusions()) {
Exclusion ex = new Exclusion();
ex.setGroupId(fromEx.getGroupId());
ex.setArtifactId(fromEx.getArtifactId());
exclusions.add(ex);
}
dependency.setExclusions(exclusions);
}
return dependency;
}
开发者ID:sundrio,项目名称:sundrio,代码行数:26,代码来源:ExternalBomResolver.java
示例16: interpolate
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
private static void interpolate(Map<String, String> dict, Iterable<Dependency> dependencies) {
if (dependencies == null) {
return;
}
for (Dependency d: dependencies) {
d.setGroupId(interpolate(dict, d.getGroupId()));
d.setArtifactId(interpolate(dict, d.getArtifactId()));
d.setVersion(interpolate(dict, d.getVersion()));
d.setClassifier(interpolate(dict, d.getClassifier()));
d.setSystemPath(interpolate(dict, d.getSystemPath()));
for (Exclusion e: d.getExclusions()) {
e.setGroupId(interpolate(dict, e.getGroupId()));
e.setArtifactId(interpolate(dict, e.getArtifactId()));
}
}
}
开发者ID:trustin,项目名称:os-maven-plugin,代码行数:18,代码来源:DetectExtension.java
示例17: testConflictManagementUsingExclusions
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
@Test
public void testConflictManagementUsingExclusions() {
Dependency dependency = new Dependency("io.vertx", "vertx-core", "3.1.0");
Exclusion exclusion1 = new Exclusion();
exclusion1.setGroupId("com.fasterxml.jackson.core");
exclusion1.setArtifactId("jackson-databind");
Exclusion exclusion2 = new Exclusion();
exclusion2.setGroupId("com.fasterxml.jackson.core");
exclusion2.setArtifactId("jackson-core");
dependency.addExclusion(exclusion1);
dependency.addExclusion(exclusion2);
Stack stack = new Stack()
.addDependency(dependency)
// Not the version used by vert.x
.addDependency(new Dependency("com.fasterxml.jackson.core", "jackson-databind", "2.4.1.3"));
StackResolution resolution = new StackResolution(stack, root, STRICT);
resolution.resolve();
Map<String, File> map = resolution.resolve();
assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0");
assertThat(map).containsKey("com.fasterxml.jackson.core:jackson-databind:jar:2.4.1.3");
}
开发者ID:vert-x3,项目名称:vertx-stack,代码行数:22,代码来源:StackResolutionTest.java
示例18: testTheResolutionWhenATransitiveDependencyIsMissingButExcluded
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
@Test
public void testTheResolutionWhenATransitiveDependencyIsMissingButExcluded() {
File local = new File("target/test-repos/incomplete");
new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact()
.addDependency(new LocalDependency("org.acme", "acme-missing", "1.0"))).build();
Exclusion exclusion = new Exclusion();
exclusion.setArtifactId("acme-missing");
exclusion.setGroupId("org.acme");
Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt");
dependency.addExclusion(exclusion);
Stack stack = new Stack()
.addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0"))
.addDependency(dependency);
StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true)
.setLocalRepository(local.getAbsolutePath());
StackResolution resolution = new StackResolution(stack, root, options);
Map<String, File> map = resolution.resolve();
assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0");
assertThat(map).containsKey("org.acme:acme:txt:1.0");
}
开发者ID:vert-x3,项目名称:vertx-stack,代码行数:24,代码来源:StackResolutionTest.java
示例19: testTheResolutionWhenATransitiveDependencyIsMissingButOptional
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
@Test
public void testTheResolutionWhenATransitiveDependencyIsMissingButOptional() {
File local = new File("target/test-repos/incomplete");
new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact()
.addDependency(new LocalDependency("org.acme", "acme-missing", "1.0").optional(true))).build();
Exclusion exclusion = new Exclusion();
exclusion.setArtifactId("acme-missing");
exclusion.setGroupId("org.acme");
Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt");
Stack stack = new Stack()
.addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0"))
.addDependency(dependency);
StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true)
.setLocalRepository(local.getAbsolutePath());
StackResolution resolution = new StackResolution(stack, root, options);
Map<String, File> map = resolution.resolve();
assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0");
assertThat(map).containsKey("org.acme:acme:txt:1.0");
}
开发者ID:vert-x3,项目名称:vertx-stack,代码行数:22,代码来源:StackResolutionTest.java
示例20: parseExclusions
import org.apache.maven.model.Exclusion; //导入依赖的package包/类
public List<Exclusion> parseExclusions(String exclusions) {
List<Exclusion> result = new ArrayList<>();
if (StringUtils.isBlank(exclusions)) {
return result;
}
Pattern.compile(";")
.splitAsStream(exclusions)
.forEach(s -> {
String[] mavenIds = Pattern.compile(":").split(s, 2);
if (mavenIds.length == 2) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId(mavenIds[0]);
exclusion.setArtifactId(mavenIds[1]);
result.add(exclusion);
}
}
);
return result;
}
开发者ID:msoute,项目名称:vertx-deploy-tools,代码行数:21,代码来源:DeployUtils.java
注:本文中的org.apache.maven.model.Exclusion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论