Skip to content

Fix For: Plugin with id 'maven' not found; 'mavenDeployer' not found; 'compile' not found #125

@jacobira

Description

@jacobira

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-static-server@0.5.0 for the project I'm working on.

This is my solution for a variety of issues as described in the title.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-static-server/android/build.gradle b/node_modules/react-native-static-server/android/build.gradle
index 0c7bca6..f0b6538 100644
--- a/node_modules/react-native-static-server/android/build.gradle
+++ b/node_modules/react-native-static-server/android/build.gradle
@@ -20,7 +20,7 @@ def safeExtGet(prop, fallback) {
 }
 
 apply plugin: 'com.android.library'
-apply plugin: 'maven'
+apply plugin: 'maven-publish'
 
 buildscript {
     // The Android Gradle plugin is only required when opening the android folder stand-alone.
@@ -39,7 +39,7 @@ buildscript {
 }
 
 apply plugin: 'com.android.library'
-apply plugin: 'maven'
+apply plugin: 'maven-publish'
 
 android {
     compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -111,7 +111,6 @@ afterEvaluate { project ->
     task androidJavadoc(type: Javadoc) {
         source = android.sourceSets.main.java.srcDirs
         classpath += files(android.bootClasspath)
-        classpath += files(project.getConfigurations().getByName('compile').asList())
         include '**/*.java'
     }
 
@@ -142,10 +141,16 @@ afterEvaluate { project ->
 
     task installArchives(type: Upload) {
         configuration = configurations.archives
-        repositories.mavenDeployer {
+        /*repositories.mavenDeployer {
             // Deploy to react-native-event-bridge/maven, ready to publish to npm
             repository url: "file://${projectDir}/../android/maven"
             configureReactNativePom pom
-        }
+        }*/
     }
 }
+
+subprojects { subproject ->
+        if(project['name'] == 'react-native-static-server'){
+            project.configurations { compile { } }
+        }
+}

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions