上传到个人maven仓库的一次记录
大致流程:
创建账号
https://bintray.com
配置Gradle
项目路径下
1 2 3 4
| dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.novoda:bintray-release:0.8.1' }
|
lib路径下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| apply plugin: 'com.android.library' apply plugin: 'com.novoda.bintray-release' android { compileSdkVersion 26
defaultConfig { minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0"
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }
buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { abortOnError false } } publish { artifactId = rootProject.artifactId repoName = rootProject.repoName userOrg = rootProject.userOrg groupId = rootProject.groupId publishVersion = rootProject.publishVersion desc = rootProject.desc website = rootProject.website licences = rootProject.licences }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0' }
|
为了方便和安全起见,我们把具体的配置参数放在rootProject下
1 2 3 4 5 6 7 8 9 10
| ext { userOrg = 'xxx' repoName = 'maven' groupId = 'com.fengan.lib' artifactId = 'permission' publishVersion = '1.0.2' desc = 'fengan permission lib' website = 'fengan.info' licences = ['Apache-2.0'] }
|
具体教程可以查看
https://www.aliyun.com/jiaocheng/16509.html
https://blog.csdn.net/xmxkf/article/details/80674232