Closed KrystilizeNevaDies closed 2 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.
@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.
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.
Update, this has been solved:
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
This code has fixed my issues, thanks.
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.
Link to build log from https://jitpack.io https://jitpack.io/com/github/KrystilizeNevaDies/JLSL/cf54cc3af5/build.log
Does the project build on your machine with the same commands (e.g. ./gradlew install) ? Yep, it builds using
./gradlew clean -Pgroup=com.github.KrystilizeNevaDies -Pversion=cf54cc3af5 -xtest build publishToMavenLocal
What error are you seeing? No apparent error:
ERROR: No build artifacts found