As much as I’d love to see a “just works for Github Release” solution, I cant see how transitive dependencies could be handled by pure magic. They must be specified by some means, and if this happens with an additional file, why not reuse the pom.xml.
This indeed requires an additional step to create the pom, but Gradle seems to be able to just create the publish pom, without actually publishing:
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/libs/${jar.baseName}-pom.xml")
}
}
In essence, this would reuse a GitHub ‘User’ as Maven repository.
Have you considered using github as a maven repository?
Yes, but pushing binaries into a git repo is not good practice. Due to the nature of git this leads to bloating the repo in no time.
Apparently the Ivy custom Url attempt would be able to handle ivy/pom files, not only binaries. This looks very promising.
A typical Url from the GitHub Releases looks like
https://github.com/MyUser/MyRepository/releases/download/v0.1.2/myArtifact-0.1.2.jar
This would yield a pattern like
repositories {
ivy {
url 'https://github.com/MyUser'
layout ('pattern') {
artifact '[organisation]/releases/download/v[revision]/[artifact]-[revision](-[classifier])(.[ext])'
}
}
}
I think I do some testing. ![]()
Edit:
After some testing I’ve run into the same issue as reported here: gradle-fails-to-download-a-dependency-if-http-head-is-not-supported-by-a-web-server
GitHub does not support HTTP HEAD on Release Urls (which are AFAIK redirected to AWS Cloud). Gradle failes if this is not possible with
Could not HEAD ‘https://github.com/MyUser/MyRepo/releases/download/v0.1.0/my-artifact-0.1.0.jar’. Received status code 403 from server: Forbidden
Oh well but almost ![]()