栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Plugin with id ‘maven‘ not found或者Plugin [id: ‘maven‘] was not found in any of the following sources

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Plugin with id ‘maven‘ not found或者Plugin [id: ‘maven‘] was not found in any of the following sources

背景 升级build.gradle 版本到7以上

官方文档:Maven Publish Plugin

修改前

apply plugin: "maven"
//本地上传
def username = "xxx"
def pwd = "xxx"

def nexusRepositoryUrl = "https://xxx.xxx.xxx/repository/total/"
def ARTIFACT_ID = 'xxxx'
def GROUP_ID = 'com.xx'

uploadArchives {

    repositories {
        mavenDeployer {
            repository(url: nexusRepositoryUrl) {
                authentication(userName: username, password: pwd)
            }
            pom.project {
                artifactId ARTIFACT_ID
                version deps.total_base.version
                groupId GROUP_ID
                packaging 'aar'
                description deps.total_base.description
            }
        }
    }
}

上面的变量不变

publishing {
    publications {

        maven(MavenPublication) {
            groupId = GROUP_ID
            artifactId = ARTIFACT_ID
            version = deps.total_china.version
            description deps.total_china.description
            afterevaluate {
                from components.release
            }
        }

    }

    repositories {
        maven {
//            非 https 的仓库地址,需要设置 allowInsecureProtocol true
//            allowInsecureProtocol true
//            name = "nexus" //可选
            url = nexusRepositoryUrl
            credentials {
                it.username = username
                it.password = pwd
            }
        }

    }
}

执行上传脚本变为

gradlew publish

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/696482.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号