1.在module.budld中添加
plugins {
id 'maven-publish'//add
}
android {
compileSdk 31
defaultConfig {
minSdk 21
targetSdk 31
multiDexEnabled=true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
//add
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
}
dependencies{
}
//add
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.wyw.plugin' //groupId 随便取
artifactId = 'wywplugin' //artifactId 随便取
version = '1.0'
}
}
}
}
2.上传/同步至github
点击发布
填写信息,并提交
3,打开jitpack官网,登录自己的github账号 jitpack.io/
4.复制项目的git地址,输入在jitpack中