-
-
Save jitpack-io/f928a858aa5da08ad9d9662f982da983 to your computer and use it in GitHub Desktop.
| install: | |
| - FILE="-Dfile=jars/my-library.jar" | |
| - mvn install:install-file $FILE -DgroupId=com.github.user -DartifactId=repo -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true |
@jitpack-io Do I need to repeat this for all the .jars? Should they all share the same artifactId, or use a unique one for each jar?
But what about .aars? Do I just need to change all instances of jar to aar?
dont you need mvn deploy to deploy things to a remote? mvn install installs it locally.
this appears to be a file you add to the root of your repo that reconfigures the jitpack build process to use this artifact instead (or as well as? not sure) of building one itself
@jitpack-io how do we dynamically define the version?
Always getting this erro.
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.hemanthkaipaa:sapostore:1.1.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.github.hemanthkaipaa:sapostore:1.1.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.hemanthkaipaa:sapostore:1.1.1.
Show Details
Affected Modules: app
I have a dependency of 3rd party aar. I'm not aware how to deal with it.
Isn't there any kind of authentication required?
Can everyone upload artifacts named with every github username?
This would be a huge security issue
@kekru the groupId and artifactId will be overwritten by JitPack at the time of build. If you put another username then the groupId will still be 'com.github.YourUsername'
@jitpack-io I published an aar by following that example. but after I used the dependency url and I can't reach the classes that exist on the aar file. it doesn't even available in library folder
@jitpack-io I published an aar by following that example. but after I used the dependency url and I can't reach the classes that exist on the aar file. it doesn't even available in library folder
@a914-gowtham @jitpack-io same for me as well. I have published jar file, but class files are not shown.
If you have any solution by now, Please suggest me. Please refer to the screenshot below for your reference.

this is how i managed to do it with a simple gradle build:
build.gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.12.1' // match your Gradle version
}
}
plugins {
id 'de.undercouch.download' version '5.1.1'
id 'maven-publish'
}
// Pass GitHub release URL and version as properties
def libVersion = project.findProperty("version") ?: System.getenv("VERSION") ?: ""
def aarUrl = project.findProperty("aarUrl") ?: System.getenv("AAR_URL") ?: ""
if (!aarUrl) {
throw new GradleException("You must provide -PaarUrl=<url-to-aar>")
}
if (!libVersion) {
throw new GradleException("You must provide -Pversion=<version>")
}
def downloadedAar = layout.buildDirectory.file("downloads/external-lib.aar")
tasks.register('downloadExternalAar', de.undercouch.gradle.tasks.download.Download) {
src aarUrl
dest downloadedAar
onlyIfModified true
doLast {
println "Downloaded AAR: ${downloadedAar.get().asFile}, size: ${downloadedAar.get().asFile.length()} bytes"
}
}
publishing {
publications {
release(MavenPublication) {
groupId = 'com.carto'
artifactId = 'carto-mobile-sdk'
version = libVersion
artifact(downloadedAar) {
builtBy(tasks.named("downloadExternalAar"))
extension = 'aar'
}
}
}
repositories {
maven {
// This points to the Maven local repository that JitPack reads
url = uri(System.getProperty("user.home") + "/.m2/repository")
}
}
}and jitpack.yml
jdk:
- openjdk17
gradle:
wrapper: true
install:
- ./gradlew publish
env:
VERSION: "5.0.0-rc.13"
AAR_URL: "https://github.com/Akylas/mobile-sdk/releases/download/v5.0.0-rc.13/carto-mobile-sdk-android-5.0.0-rc.13.aar"
For this to work the root directory also needs to have a pom.xml file: