jitpack / jitpack.io

Documentation and issues of https://jitpack.io
MIT License
2.54k stars 185 forks source link

No build artifacts found #4785

Closed KrystilizeNevaDies closed 2 years ago

KrystilizeNevaDies commented 3 years ago

ERROR: No build artifacts found


Thank you!
Vipinbalakrishnan commented 3 years ago

@KrystilizeNevaDies

I am able to successfully release my library to jitpack.io by the following steps.

1.Update gradle plugin version to the latest in build.gradle file -of the project root in the dependencies section as below.

dependencies { classpath "com.android.tools.build:gradle:7.0.2" }

2.Add jitpack.io repository to build.gradle file of the root as well as the library module of the project as below.


repositories { google() mavenCentral() maven { url "https://jitpack.io" } }


3.Add plugin maven-publish in the build.gradle file of the module as below along with library plugin.

plugins { id 'com.android.library' id 'maven-publish' }

4.Add jitpack.yml in the root of the project for JAVA 11 support. Create a file with name as 'jitpack.yml' with the following content

jdk:

(read as, space hyphen space opejdk11 or copy the whole text)

5.Change java version to 11 in build.gradle file of the app module and library module inside android {} as below New gradle plugin builds on java 11.

compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 }

6.Added maven publication settings as below in the build.gradle of module.

afterEvaluate { publishing { publications { // Creates a Maven publication called "release". release(MavenPublication) { from components.release groupId = 'com.github.Vipinbalakrishnan' artifactId = 'ribbonlayout' version = '1.1' } } } }

Note:- Sixth step is necessary.

KrystilizeNevaDies commented 3 years ago

@Vipinbalakrishnan

While I thank you for your reply, this only works with openjdk11, I have tried doing the same for java 17 (which is what I need), and it has not worked.

KrystilizeNevaDies commented 3 years ago

To add on to this issue, it has happened again in another project of mine here. If anyone can point me to why this is happening, that would be much appreciated.

KrystilizeNevaDies commented 2 years ago

Update, this has been solved:

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
}

This code has fixed my issues, thanks.

SharmaShubham07 commented 1 month ago

I was having the same issue today and finally it has been resolved

The thing i did is just deleted my .yml file and let the compiler find it manually and the isuue will be resolved.

Hope this finds you well and will help you.