raury
raury

Reputation: 95

How to solve Jitpack "ERROR: No build artifacts found"?

Jitpack builds my project with this logs. As you can see there is an error: "ERROR: No build artifacts found".

What i do wrong?

Here is my gradle.build:

plugins {
    id 'java'
    id 'maven-publish'
}

group 'com.github.azzztec'
version '1.0.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}

test {
    useJUnitPlatform()
}

wrapper {
    gradleVersion = "7.0.2"
    distributionType = Wrapper.DistributionType.ALL
}

Upvotes: 3

Views: 3527

Answers (2)

android developer
android developer

Reputation: 116342

If it's on Android, do as such: https://github.com/jitpack/jitpack.io/issues/3814#issuecomment-997228875

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

...
android {
...
}
afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
            }
        }
    }
}

Upvotes: 0

Huka
Huka

Reputation: 390

I got the same issue as you, then I fixed it by following these steps:

  1. Add publish plugin
id 'maven-publish'
  1. Custom publishing
publishing {
    publications {
        mavenJava(MavenPublication) {
            groupId = 'org.gradle.sample'
            artifactId = 'library'
            version = '1.1'

            from components.java
        }
    }
}

You can see the full example here: https://github.com/hukacode/huka-common/blob/main/build.gradle

Upvotes: 12

Related Questions