Plugin 'maven' not found

Hello,

I’m trying to compile “CircularMapper”. I have modified “build.gradle” file in this way (only first lines:

group 'com.uni-tuebingen.de.it.eager.circularmapper'
    version '1.93.5'


    buildscript {
        repositories {
            maven {
                    url "https://plugins.gradle.org/m2/"
            }
            mavenCentral()
        }
        dependencies {
            classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
        }
    }


    subprojects {
        repositories {
            maven {
                    url "https://plugins.gradle.org/m2/"
            }
            mavenCentral()
        }
        apply plugin: 'maven'
        apply plugin: 'maven-publish'
        apply plugin: 'java'
        apply plugin: 'idea'
        apply plugin: 'com.jfrog.bintray'
        apply plugin: 'jacoco'

    }

When I run “grandle build” I get these error:

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/SRC/CircularMapper/build.gradle’ line: 25

  • What went wrong:
    A problem occurred evaluating root project ‘CircularMapper’.

Plugin with id ‘maven’ not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Line 25 is “apply plugin: ‘maven’”

What can I do? This is my first try with “gradle”.

Thanks.

In my opinion that project has a serious bug, which is that it is not using the Gradle wrapper.
Those are 4 files that you check in along with your project and then use to start Gradle.
These make sure the build is run with the exact Gradle version the build is designed for and known to work with.
And it also removes the need to install Gradle manually as the wrapper will automatically handle that.
Imho each project not using the Gradle wrapper should be considered buggy.

Your case shows exactly why it is important.
You are using Gradle 7 to try to run that build.
But in Gradle 7 the maven plugin was removed after being deprecated for quite some time.
So that build is not compatible with Gradle 7.
I also cannot tell you with which version the build actually is compatible, as that is what the wrapper would define and the readme is little helpful in that regard.

My advice is to open an issue against that project so that they add the Gradle wrapper which is also the officially recommended way to start Gradle (Gradle User Manual: Version 7.0).
Or if the maintainer does not want to for whatever reason at least to document which exact Gradle version the build is designed for.

In the meantime you could either try fixing the build to be compatible with Gradle 7 or try to find a Gradle version with which the build seems to work as intended.