Plugin with id 'maven' not found

Viewed 56973

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.

3 Answers

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

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.

Related