Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error with Gradle v7 - Plugin with id 'maven' not found. #471

Open
novseje opened this issue Sep 30, 2021 · 14 comments
Open

Build error with Gradle v7 - Plugin with id 'maven' not found. #471

novseje opened this issue Sep 30, 2021 · 14 comments

Comments

@novseje
Copy link

novseje commented Sep 30, 2021

When I build project with Gradle v7 I got error:

Plugin with id 'maven' not found.

For those using gradle 7, maven plugin has been removed, now you should use maven-publish, as described in official site at this link: https://docs.gradle.org/7.0/userguide/upgrading_version_6.html?_ga=2.21245883.1883799052.1624281891-1948725710.1624281891#removal_of_the_legacy_maven_plugin

So, instead of using:
apply plugin: 'maven'
you should use
apply plugin: 'maven-publish'

@jaydeep-reactnative
Copy link

@novseje Still facing same error after changing plugin: 'maven-publish' & Gradle v7

@aknad
Copy link

aknad commented Mar 30, 2022

Changing the plugin to 'maven-publish' solves the issue but now I've a new error:

Could not find method mavenDeployer() for arguments [build_entzzzqdm3f25a31lwmklzs9s$_run_closure4$_closure15$_closure17@5b19aaf] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

@mitchiemt11
Copy link

mitchiemt11 commented Jul 5, 2022

Changing the plugin to 'maven-publish' solves the issue but now I've a new error:

Could not find method mavenDeployer() for arguments >[build_entzzzqdm3f25a31lwmklzs9s$_run_closure4$_closure15$_closure17@5b19aaf] on repository container of type >org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Still facing this problem. Anyone with a solution??
@aknad any solution on this?

@navaneeth-algorithm
Copy link

A problem occurred configuring project ':react-native-tesseract-ocr'.

Could not find method mavenDeployer() for arguments [build_450w1e7my5x04n2mez1rogjko$_run_closure4$_closure15$_closure17@69dd66a3] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Same here , any solution for this problem?

@navaneeth-algorithm
Copy link

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/

@iasreact1
Copy link

@navaneeth-algorithm it was already commented out here but though the same issue occured any idea to solve the issue

Could not find method mavenDeployer() for arguments [build_1vgpslp8jdh77190hqiajl56s$_run_closure4$_closure16$_closure18@2a8bde30] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

@tkud04
Copy link

tkud04 commented Dec 7, 2022

Commenting it out solved my case

@ShooreshS
Copy link

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/

My project build successfully but cannot perform the read function.

The following is console error:

tesseract.min.js:2 Uncaught Error: Error: FS error
    at tesseract.min.js:2:39459
    at t.onmessage (tesseract.min.js:2:53506)
(anonymous) @ tesseract.min.js:2
t.onmessage @ tesseract.min.js:2

@topzhanghj
Copy link

i just commented out and was able to run successfully

/*task installArchives(type: Upload) {
    configuration = configurations.archives
    repositories.mavenDeployer {
        // Deploy to react-native-event-bridge/maven, ready to publish to npm
        repository url: "file://${projectDir}/../android/maven"
        configureReactNativePom pom
    }
}*/

sovle my problem ,thx !!!

@Napsterwanp
Copy link

or you can replace mavenDeployer to publications, such as

publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId 'groupid'
                artifactId 'artifcatId'
                version 'version'
            }
        }
    }

@hariantara
Copy link

installArchives

should be inside installArchives ?

@kavithareddyedula
Copy link

what`s the equivalent to this all projects in Gradle 7 allprojects {
apply plugin: 'maven-publish'
uploadArchives {
repositories.mavenDeployer {
snapshotRepository(url: snapshotsRepositoryURL) {
}
repository(url: corporateRepositoryURL) {
}
}
}
repositories {
maven {
url 'https://artifactory.xyz.com/xyz/'
}

@alidavodii
Copy link

alidavodii commented Jun 7, 2024

i just commented out and was able to run successfully

task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.mavenDeployer {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"
            configureReactNativePom pom
        }
    }

@skumhar
Copy link

skumhar commented Oct 9, 2024

i just commented out and was able to run successfully

task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.mavenDeployer {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"
            configureReactNativePom pom
        }
    }

@alidavodii Here’s a refined version:

I commented out the code and was able to run it successfully, but as you know, these changes are in the node_modules folder. When the library is updated, the changes will be overwritten. How can I resolve this permanently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests