25

Plugin with id 'maven' not found.

I got this error in IDEA that uses with 7.1, that is strange as maven is built-in plugin, and should be distributed with gradle.

subprojects {
    apply plugin: 'java'
    apply plugin: 'java-library'
    apply plugin: 'maven'

When running Gradle 6.3, it seems there is no such error.

Paul Verest
  • 55,983
  • 44
  • 191
  • 313

3 Answers3

40

In Gradle 7.x,

The maven plugin has been removed. You should use the maven-publish plugin instead.

Reference: https://docs.gradle.org/7.0/userguide/upgrading_version_6.html#removal_of_the_legacy_maven_plugin

Gokul Nath KP
  • 14,745
  • 24
  • 85
  • 122
  • 1
    sir, I'm new to react-native it stuck in build.gredle file "repository url: "file://${projectDir}/../android/maven", i dont know why? – Eliot Apr 14 '22 at 07:26
  • 2
    please provide full example, I'm new to gradle, can't understand in which part of file I need do changes. thank you – CodeBy Apr 15 '22 at 10:09
13

The maven plugin was removed in Gradle 7. The documentation suggests to use maven-publish plugin instead.

Ondra K.
  • 2,367
  • 3
  • 21
  • 38
3

As the docs says that the maven plugin was removed and to use the maven-publish plugin instead

Another approach was to use the gradle wrapper with version less than 7. Since wrapper is customizable. Creating a wrapper could be found here

So for example gradle clean build is equivalent to ./gradlew clean build

Since the version of wrapper is less than 7 every task can be ran with the help of ./gradlew <task> or ./gradlew.bat <task>

This worked for me.

Krithick S
  • 139
  • 1
  • 12