Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot locate a Guava Jar in the gradle distribution?

I have the following error while performing the gradle build command.

  • What went wrong:
Execution failed for task ':asciidoctor'.
> Cannot locate a Guava JAR in the Gradle distribution

I'm using macOS Big Sur.

like image 758
Apelli Avatar asked Oct 19 '21 20:10

Apelli


People also ask

What is the configuration for the external guava dependency in Gradle?

The configuration has the attributes org.gradle.usage=java-runtime,org.gradle.libraryelements=jar,minified=true . The external guava dependency has two variants: org.gradle.usage=java-runtime,org.gradle.libraryelements=jar,minified=false and org.gradle.usage=java-api,org.gradle.libraryelements=jar,minified=false.

Where to put JAR files in Gradle?

Before Gradle, we used to download the JAR file and put it in the libs folder. Now Gradle handles these things automatically for us. However, this process is still supported with Gradle for special purposes like custom JAR files. 3. Flat Directory

How do I use a flat directory in Gradle?

Flat Directory If we want to use a flat filesystem directory as our repository, we need to add the following to our build.gradle file: This makes Gradle look into lib1 and lib2 for dependencies. Once we set the flat directories, we can use our local JAR file from the lib1 or lib2 folder:

How does Gradle work with artifacts?

As soon as Gradle finishes resolving the artifacts for the variant, either by downloading an external dependency or executing a task producing the artifact, Gradle starts transforming the artifacts of the variant with the selected chain of artifact transforms. Gradle executes the transform chains in parallel when possible.


Video Answer


1 Answers

I had the same issue on my system.

It appears the problem was the use of the "3.2.0" version of "asciidoctor" plugins. The gradle version I'm currently using is "7.2".

This is the plugins section that was causing the problem:

plugins {
   id("org.asciidoctor.jvm.pdf") version "3.2.0"
   id("org.asciidoctor.jvm.gems") version "3.2.0"
   id("org.asciidoctor.jvm.convert") version "3.2.0"
}

The fix was just to update the versions of these plugins to the latest version, which is "3.3.2".

like image 163
Harmon Nine Avatar answered Oct 19 '22 19:10

Harmon Nine