Elasticsearch build failure

Hello,

I was running ELK from source, and today I run "git pull" and tried to build again, but when I run "./gradlew assemble" I am getting these errors :

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'elasticsearch'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve project :build-tools-internal.
     Required by:
         project :
      > No matching variant of project :build-tools-internal was found. The consumer was configured to find a runtime of a library compatible with Java 15, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.1' but:
          - Variant 'apiElements' capability org.elasticsearch.gradle:build-tools-internal:8.0.0-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 16 and the consumer needed a runtime of a component compatible with Java 15
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.1')
          - Variant 'runtimeElements' capability org.elasticsearch.gradle:build-tools-internal:8.0.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 15
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.1')

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 54s
4 actionable tasks: 4 executed

I tried with both Java 15 and Java 16 and still getting the same error

Any help please !
Best regards

You should use Java 16 GA version. Are you by chance using Java 16 EA version?

1 Like

Thanks for your answer @mayya ,

Tthe error is cleared now, but I had a new errors when I try to build it :


2: Task failed with an exception.
-----------
* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
19 actionable tasks: 19 up-to-date

and when I try ./gradlew clean


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':distribution:archives:linux-tar:clean'.
> java.io.IOException: Unable to delete directory '/home/ELK-8/elasticsearch/distribution/archives/linux-tar/build'
    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/LICENSE.txt
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/NOTICE.txt
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/plugin-descriptor.properties
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size/mapper-size-8.0.0-SNAPSHOT.jar
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins/mapper-size
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT/plugins
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install/elasticsearch-8.0.0-SNAPSHOT
    - /home/ELK-8/elasticsearch/distribution/archives/linux-tar/build/install

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

Just wanted to let you know that the Gradle version I am using is Gradle 7.1, and the build process works for me.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.