Back

[SOLVED] BuildJar failed on deploying function

  • 0
  • Functions
Danish
13 Oct, 2023, 18:05

Working on sync-with-meilisearch java-17 template and on deploying the function, I get buildJar fail error. Using self-hosted appwrite v1.4.3. Err: ```

Task :compileJava Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :processResources Task :classes Task :buildJar FAILED

FAILURE: Build failed with an exception.

TL;DR
Solution: The user was experiencing a "BuildJar failed" error while deploying a function. Another user suggested adding the following dependencies to the `deps.gradle` file: ```gradle dependencies { implementation 'io.appwrite:sdk-for-kotlin:4.0.0' implementation 'com.meilisearch.sdk:meilisearch-java:0.11.2' } ``` They also suggested adding the following code snippet to the `build.gradle` file: ```gradle tasks.withType(Jar) { duplicatesStrategy = DuplicatesStrategy.INCLUDE } ``` The user who encountered the error
Drake
15 Oct, 2023, 03:42

What dependencies did you add to your deps.gradle?

Danish
15 Oct, 2023, 04:16
TypeScript
    implementation 'io.appwrite:sdk-for-kotlin:4.0.0'
    implementation 'com.meilisearch.sdk:meilisearch-java:0.11.2'
}```
Drake
15 Oct, 2023, 19:23

What's in your folder that's being uploaded?

Danish
15 Oct, 2023, 19:25

src/Main.java, static/index.html, deps.gradle, .env, Readme.md, and .gitignore

Drake
18 Oct, 2023, 16:21

maybe you can try:

TypeScript
dependencies {
    implementation 'io.appwrite:sdk-for-kotlin:4.0.0'
    implementation 'com.meilisearch.sdk:meilisearch-java:0.11.2'
}

tasks.withType(Jar) {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

I got it to build by doing this...i don't really know java to know more about this, though

Danish
18 Oct, 2023, 16:37

worked thanks

Danish
18 Oct, 2023, 16:38

[SOLVED] BuildJar failed on deploying function

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more