Search code examples
javajitpack

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
}

Solution

  • 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