org.gradle.api.artifacts.Configuration.exclude()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中org.gradle.api.artifacts.Configuration.exclude()方法的一些代码示例,展示了Configuration.exclude()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.exclude()方法的具体详情如下:
包路径:org.gradle.api.artifacts.Configuration
类名称:Configuration
方法名:exclude

Configuration.exclude介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

private void addExclude( final String group, final String module )
  {
    final Map<String, String> map = Maps.newHashMap();
    if ( group != null )
    {
      map.put( "group", group );
    }

    if ( module != null )
    {
      map.put( "module", module );
    }

    this.config.exclude( map );
  }
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

private void addExclude( final String group, final String module )
  {
    final Map<String, String> map = Maps.newHashMap();
    if ( group != null )
    {
      map.put( "group", group );
    }

    if ( module != null )
    {
      map.put( "module", module );
    }

    this.config.exclude( map );
  }
}

代码示例来源:origin: io.freefair.gradle/android-gradle-plugins

protected void createConfigurations() {
  Configuration configuration = project.getConfigurations().create(getConfigurationName());
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The " + getToolName() + " libraries to be used for this project.");
  // Don't need these things, they're provided by the runtime
  configuration.exclude(excludeProperties("ant", "ant"));
  configuration.exclude(excludeProperties("org.apache.ant", "ant"));
  configuration.exclude(excludeProperties("org.apache.ant", "ant-launcher"));
  configuration.exclude(excludeProperties("org.slf4j", "slf4j-api"));
  configuration.exclude(excludeProperties("org.slf4j", "jcl-over-slf4j"));
  configuration.exclude(excludeProperties("org.slf4j", "log4j-over-slf4j"));
  configuration.exclude(excludeProperties("commons-logging", "commons-logging"));
  configuration.exclude(excludeProperties("log4j", "log4j"));
}

代码示例来源:origin: gradle.plugin.com.devtub.scramble/java-defaults-gradle-plugin

@Override
 public void execute(Project project) {

  RepositoryHandler repositories = project.getRepositories();
  repositories.mavenLocal();
  repositories.jcenter();
  repositories.maven(repository -> repository.setUrl(URI.create("https://repo.spring.io/libs-milestone")));

  DependencyHandler dependencies = project.getDependencies();
  dependencies.add("compileOnly", "org.projectlombok:lombok");
  dependencies.add("compileOnly", "org.springframework.boot:spring-boot-configuration-processor");

  project.getConfigurations().all(configuration -> {
   Map<String, String> excludeLogging = new HashMap<>();
   excludeLogging.put("group", "org.springframework.boot");
   excludeLogging.put("module", "spring-boot-starter-logging");
   configuration.exclude(excludeLogging);
  });
 }
}

代码示例来源:origin: gradle.plugin.com.triplequote.gradle/hydra

@Override
public FileCollection createDelegate() {
  checkRequiredSettings(project, hydraSettings);
  String scalaVersion = getScalaVersion(classpath);
  Configuration hydraConfiguration = project.getConfigurations().detachedConfiguration(
      new DefaultExternalModuleDependency("com.triplequote", "hydra_" + scalaVersion, hydraSettings.getVersion())
  );
  hydraConfiguration.exclude(excludeProperties("org.scala-lang", "scala-reflect"));
  hydraConfiguration.exclude(excludeProperties("com.triplequote", "scala-library"));
  LOGGER.debug("Hydra version: {}. Inferred Scala classpath: {}", hydraSettings.getVersion(), hydraConfiguration.getFiles());
  Configuration hydraDashboardConfiguration = project.getConfigurations().getByName(HydraBasePlugin.HYDRA_DASHBOARD_CONFIGURATION);
  if (hydraDashboardConfiguration.getDependencies().isEmpty()) {
    hydraDashboardConfiguration.getDependencies().add(
        new DefaultExternalModuleDependency("com.triplequote", "dashboard-client_2.12", hydraSettings.getMetricsServiceVersion())
    );
  }
  return hydraConfiguration;
}

相关文章