For some reason I fail to import/export my kotlin ...
# gradle
s
For some reason I fail to import/export my kotlin lib (https://github.com/simon-void/ksv4ever) from/to JitPack which is very strange because according to JitPack (https://jitpack.io/), I only have to add this to my build-file
Copy code
repositories {
    maven(url = "<https://jitpack.io>")
}
dependencies {
	implementation("com.github.User:Repo:Tag")
}
to my gradle-build file, in my case that's
Copy code
repositories {
    maven(url = "<https://jitpack.io>")
}
dependencies {
	implementation("simon-void:ksv4ever:1.1.3")
}
So I've done just that, but the lib is simply not present/correctly imported. What am I missing?? Does Jippack have a requirement of an pom.xml being presen? (The intro doesn't mention it.) Version 1.1.3 is actually configured to produce a pom.xml file (see https://github.com/simon-void/ksv4ever/blob/master/build.gradle.kts) but for some reason doesn't.
v
A word of warning first, JitPack is horribly unreliable, broken by design and should imho not be used for publishing except for short-term testing things and even then it is better to use something like composite builds. But regarding the actual problem, as you can see at https://jitpack.io/com/github/simon-void/ksv4ever/1.1.3/build.log JitPack uses
./gradlew clean -Pgroup=com.github.simon-void -Pversion=1.1.3 -xtest build publishToMavenLocal
and in the end detects
net.simonvoid:ksv4ever:1.1.3
found as artifact. I think it depends on the group and version being taken from the properties, so if you don't define the group and version in your build script and thus ignoring the project properties, but instead set it in your
gradle.properties
file I guess it will rcognize the built artifacts.
Or well, no, it seems to not depend on it
As you can see at https://jitpack.io/com/github/simon-void/ksv4ever/1.1.3/ it was built and is available, so you should be able to use it
But `implementation("simon-voidksv4ever1.1.3")`is wrong of course
It should be
implementation("com.github.simon-void:ksv4ever:1.1.3")
as you mentioned 😉
s
ah! thanks! 😅
if JitPack is unreliable and with bintray being sunsetted, what other free-of-charge publishing options do I have?
v
The canonical repository for Maven dependencies is Maven Central. I always deploy things there, as then it is available out-of-the-box to all Maven builds and also to most Gradle builds, as most will have the Maven Central repository declared, latest when JitPack vanished. It is a little bit cumbersome to set up initially if you never did it to get an account, the namespace assinged and signing configured, but after that it just works.
You can also publish to GitHub packages, but there anonymous consumption does not yet work but requires a personal access token.