Sonatype Nexus兼容apk格式仓库

Sonatype Nexus兼容apk格式仓库

sonatype/nexus3
当前最新版本:sonatype/nexus3:3.52.0

查看nexus支持的仓库格式

创建一个nexus 容器:

docker run -d -p 8081:8081 --name nexus sonatype/nexus3:3.52.0

查看启动日志:

docker logs nexus -f

访问nexus 仓库:
在这里插入图片描述
进入容器查看初始密码:

docker exec -it nexus bash

cat /nexus-data/admin.password

通过查看Repositories可以看到支持的仓库格式:
在这里插入图片描述
可以发现sonatype/nexus3:3.52.0版本是不支持apk格式的仓库的
如果以apt格式配置apk的仓库,例如:
https://dl-cdn.alpinelinux.org/alpine/
会有如下的报错:

xxx package mentioned in index not found (try 'apk update')

即使执行了apk update后仍然无法从nexus地址下载仓库资源
在这里插入图片描述

配置第三方插件nexus-repository-apk

nexus-repository-apk
插件与nexus版本兼容关系:向上兼容

Plugin VersionNexus Repository Version
v0.0.13.19.0-01
v0.0.83.23.0-03
v0.0.123.28.0-01
v0.0.183.30.0-01
v0.0.193.31.0-01
v0.0.243.38.0-01
v0.0.263.41.0-01

通过github拉取源码后进行编译:

mvn clean package -PbuildKar

编译完成后,将路径:

  • nexus-repository-apk/target/nexus-repository-apk-0.0.26-bundle.kar

文件复制到nexus下的/opt/sonatype/nexus/deploy/

具体的印射方法为:

docker run -d --name nexus -p 8081:8081 -v $文件目录:/opt/sonatype/nexus/deploy/ -e  sonatype/nexus3:3.52.0

再次重启nexus可以看到,已经可以支持apk格式的仓库了:
在这里插入图片描述

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { agp_version = '4.1.3' } ext.kotlin_version = '1.4.10' repositories { maven { url 'https://maven.aliyun.com/repository/public/' } google() mavenCentral() maven {url 'https://developer.huawei.com/repo/'} // 华为 maven 仓库地址 maven {url "https://mvn.mob.com/android"} //maven { url "https://jitpack.io" } } dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // 添加的部分 classpath "com.android.tools.build:gradle:$agp_version" classpath "io.realm:realm-gradle-plugin:3.7.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0' classpath 'com.huawei.agconnect:agcp:1.4.2.300' // 华为推送 gradle 插件依赖 classpath "com.mob.sdk:MobSDK:+" classpath 'com.jakewharton:butterknife:10.1.0' classpath 'com.jakewharton:butterknife-compiler:10.1.0' } } allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/public/' } maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } maven { url "https://maven.aliyun.com/nexus/content/repositories/releases" } google() mavenCentral() flatDir { dirs '../baseproject/libs','../imchat/libs' } maven { url "https://jitpack.io" } maven {url "https://raw.github.com/bmob/bmob-android-sdk/master" } maven { url 'https://developer.huawei.com/repo' } } } tasks.register('clean', Delete) { delete rootProject.buildDir } ext { // yss_versionCode = 30 yss_versionName = '1.3.0' // mxyy_versionCode = 80 mxyy_versionName = '1.1.0' // Sdk and tools compileSdkVersion = 30 buildToolsVersion = '30.0.0' minSdkVersion = 19 targetSdkVersion = 30 // App dependencies supportVersion = '28.0.0' constraintLayoutVersion = '1.1.3' butterknifeVersion = '10.1.0' gsonVersion = '2.8.9' autolayoutVersion = '1.4.5' videocacheVersion = '2.6.4' photoViewVersion = '1.2.7' imageLoaderVersion = '1.9.5' observablescrollviewVersion = '1.6.0' // rxjavaVersion = '1.3.0' rxAndroidVersion = '1.2.1' okhttp3Version = '4.9.3' okhttp3LogVersion = '4.9.3' retrofit2GsonVersion = '2.9.0' retrofit2RxjavaVersion = '2.4.0' retrofit2Version = '2.9.0' eventbusVersion = '3.0.0' }
最新发布
03-29
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值