diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index a0297d91d1296..4672e56eff4a6 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -5,17 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -import java.nio.file.Files -import java.nio.file.Path - apply plugin: 'elasticsearch.internal-distribution-archive-setup' CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, boolean isTestDistro) { return copySpec { into("elasticsearch-${version}") { into('lib') { - with libFiles("$platform-" + ((architecture == 'x64') ? 'x86_64' : architecture)) + with libFiles("$platform-" + ((architecture == 'x64') ? 'x86-64' : architecture), isTestDistro) } into('config') { dirMode 0750 diff --git a/distribution/build.gradle b/distribution/build.gradle index c936053acec5e..bdc754a937575 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -300,10 +300,18 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { /***************************************************************************** * Common files in all distributions * *****************************************************************************/ - libFiles = { platform -> + libFiles = { platform, isTestDistro -> copySpec { // Delay by using closures, since they have not yet been configured, so no jar task exists yet. - from(configurations.libs) + from(configurations.libs) { + if (isTestDistro == false) { + // Remove native binary jars not-applicable to this distribution + def excludePlatforms = ['linux-x86-64', 'linux-aarch64', 'windows-x86-64', 'darwin-x86-64', 'darwin-aarch64'] - platform + excludePlatforms.each { + exclude "**/*-${it}.jar" + } + } + } into('java-version-checker') { from(configurations.libsVersionChecker) } diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 79559ab9b25c2..d2b9c33e5f41f 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -140,7 +140,7 @@ def commonPackageConfig(String type, String architecture) { fileMode 0644 } into('lib') { - with libFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture)) + with libFiles('linux-' + ((architecture == 'x64') ? 'x86-64' : architecture), false) } into('modules') { with modulesFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))