daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Oct 17th, 2017 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.elasticsearch.gradle.MavenFilteringHack
  2. import org.elasticsearch.gradle.VersionProperties
  3. import org.elasticsearch.gradle.test.RestIntegTestTask
  4.  
  5. version = '5.5.1'
  6.  
  7. buildscript {
  8.     repositories {
  9.         jcenter()
  10.         maven {
  11.             url "https://artifacts.elastic.co/maven"
  12.         }
  13.     }
  14.  
  15.     dependencies {
  16.         classpath "org.elasticsearch.gradle:build-tools:5.5.1"
  17.     }
  18. }
  19.  
  20. apply plugin: 'elasticsearch.build'
  21. apply plugin: 'idea'
  22. apply plugin: 'eclipse'
  23.  
  24. repositories {
  25.     jcenter()
  26.     maven {
  27.         url "https://artifacts.elastic.co/maven"
  28.     }
  29. }
  30.  
  31. dependencies {
  32.     provided "org.elasticsearch:elasticsearch:${version}"
  33.     provided "org.elasticsearch.plugin:x-pack-api:${version}"
  34.     provided "org.elasticsearch:jna:4.4.0"
  35.     testCompile "org.elasticsearch.test:framework:${version}"
  36.     testCompile "org.elasticsearch.client:x-pack-transport:${version}"
  37.     testCompile "org.apache.lucene:lucene-test-framework:${versions.lucene}"
  38.     testCompile "org.apache.logging.log4j:log4j-api:${versions.log4j}"
  39.     testCompile "org.apache.logging.log4j:log4j-core:${versions.log4j}"
  40.     testRuntime "org.elasticsearch.plugin:x-pack:${version}@zip"
  41.  
  42. }
  43.  
  44. Map generateSubstitutions() {
  45.     def stringSnap = { version ->
  46.         if (version.endsWith("-SNAPSHOT")) {
  47.             return version.substring(0, version.length() - 9)
  48.         }
  49.         return version
  50.     }
  51.     return [
  52.             'version'      : stringSnap(version),
  53.             'xpack.version': stringSnap(VersionProperties.elasticsearch),
  54.             'java.version' : targetCompatibility as String
  55.     ]
  56. }
  57.  
  58. processResources {
  59.     MavenFilteringHack.filter(it, generateSubstitutions())
  60. }
  61.  
  62. task buildZip(type: Zip, dependsOn: [jar]) {
  63.     from 'build/resources/main/x-pack-extension-descriptor.properties'
  64.     from project.jar
  65. }
  66.  
  67.  
  68. RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class) {
  69.     runner.systemProperty 'tests.security.manager', 'false'
  70. }
  71. integTest.mustRunAfter(project.precommit, project.test)
  72. project.check.dependsOn(integTest)
  73.  
  74. integTestCluster {
  75.     dependsOn buildZip
  76.     setting "xpack.monitoring.enabled", "false" // monitoring depends on painless which is not available to us
  77.     setting "xpack.ml.enabled", "false"
  78.     // ml has named writeables and the check for cluster state consistency doesn't know about them
  79.     setting "xpack.security.authc.realms.custom.order", "0"
  80.     setting "xpack.security.authc.realms.custom.type", "custom"
  81.     setting "xpack.security.authc.realms.custom.users.user1.password", "changeme"
  82.     setting "xpack.security.authc.realms.custom.users.user1.roles", "superuser"
  83.     setting "xpack.security.authc.realms.custom.users.user2.password", "changeme"
  84.     setting "xpack.security.authc.realms.custom.users.user2.roles", "superuser"
  85.     setting "xpack.security.authc.realms.custom.users.user3.password", "changeme"
  86.     setting "xpack.security.authc.realms.custom.users.user3.roles", "superuser"
  87.     setting "xpack.security.authc.realms.file.order", "1"
  88.     setting "xpack.security.authc.realms.file.type", "file"
  89.  
  90.     setupCommand 'installXPackPlugin',
  91.             'bin/elasticsearch-plugin', 'install', configurations.testRuntime.filter { File file -> file.getName().equals("x-pack-${version}.zip".toString()) }.getSingleFile().toURI().toString()
  92.     setupCommand 'setupDummyUser',
  93.             'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'superuser'
  94.     setupCommand 'installExtension',
  95.             'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath
  96.     waitCondition = { node, ant ->
  97.         File tmpFile = new File(node.cwd, 'wait.success')
  98.         ant.get(src: "http://${node.httpUri()}",
  99.                 dest: tmpFile.toString(),
  100.                 username: 'test_user',
  101.                 password: 'changeme',
  102.                 ignoreerrors: true,
  103.                 retries: 10)
  104.         return tmpFile.exists()
  105.     }
  106.    
  107. compile fileTree(dir: 'libs', include: '*.jar')
  108.    
  109. Caused by: org.gradle.api.InvalidActionClosureException: The closure 'org.elasticsearch.gradle.BuildPlugin$_configureConfigurations_closure5@37f4e96' is not valid as an action for argument 'org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_Decorated@433edba9'. It should accept no parameters, or one compatible with type 'org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_Decorated'. It accepts (org.gradle.api.artifacts.ModuleDependency).
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top