Elias Meireles
Elias Meireles

Reputation: 1058

Jitpack application built successfully but failed to publish with the error: Directory '/tmp' does not contain a Gradle build

Trying to publish a plugin lib on Jitpack, i'm facing a error printed at the end of log file.

All the Gradle tasks were successfully executed, but the 'publishment' exited with the error below.

FAILURE: Build failed with an exception.

* What went wrong:
Directory '/tmp' does not contain a Gradle build.

A Gradle build should contain a 'settings.gradle' or 'settings.gradle.kts' file in its root directory. It may also contain a 'build.gradle' or 'build.gradle.kts' file.

To create a new Gradle build in this directory run 'gradle init'

For more information about the 'init' task, please refer to https://docs.gradle.org/8.5/userguide/build_init_plugin.html in the Gradle documentation.

For more details on creating a Gradle build, please refer to https://docs.gradle.org/8.5/userguide/tutorial_using_tasks.html in the Gradle documentation.

* Try:
> Run gradle init to create a new Gradle build in this directory.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
2024-01-27T21:01:40.451451802Z
Exit code: 0

⚠️ ERROR: No build artifacts found

Customized publishing setup.

jdk:
  - openjdk21
before_install:
  - sdk install 21.ea.35-open
  - sdk use java 21.ea.35-open
  - sdk install gradle 8.5
  - sdk use gradle 8.5
install:
  make publish

Upvotes: 0

Views: 102

Answers (1)

Elias Meireles
Elias Meireles

Reputation: 1058

A little moment after submitting this question, I found a solution. I can't explain why, but I have just migrated to using the installed machine Gradle for the project, wrapped gradlew, as shown below.

  • Before
## jitpack.yml

jdk:
  - openjdk21
before_install:
  - sdk install 21.ea.35-open
  - sdk use java 21.ea.35-open
  - sdk install gradle 8.5
  - sdk use gradle 8.5
install:
  make publish

## Makefile script execution

publish:
   gradle clean assemble publishToMavenLocal -xtest
  • After
## jitpack.yml

jdk:
  - openjdk21
before_install:
  - sdk install 21.ea.35-open
  - sdk use java 21.ea.35-open
install:
  make publish

## Makefile script execution

publish:
   ./gradlew clean assemble publishToMavenLocal -xtest

Upvotes: 0

Related Questions