Plugin with id ‘maven’ not found

问题描述 原因分析 解决方案

apply plugin: 'maven' 


uploadArchives {
    repositories.mavenDeployer {
        repository(url:uri('../repo'))
        pom.groupId = 'com.hougr'
        pom.artifactId = 'transform.printjar'
        pom.version = '1.0.0'
    }
}

报错:

Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'maven' not found.

Gradle 7版本将maven插件移除了,用maven publish插件替代。

参考:maven-publish插件的使用_不悔的青春-CSDN博客

apply plugin: 'maven-publish'

publishing {
    publications {
        publish2Local(MavenPublication) {
            groupId = 'com.hougr'
            artifactId = 'transform.printjar'
            version = '1.0.0'

            from components.java
        }
    }

    repositories {
        maven {
            url = "$buildDir/repo"
        }
    }
}

你可能感兴趣的:(Android开发,android,maven)