Skip to content

Gradle sync problem with maven-publish plugin #29

@amorenkov

Description

@amorenkov

agp = "8.9.1"
gradle = 8.11.1
grease = "0.3.4"

Have sample aar project, just adding maven-publish in plugins and describe publications, press "gradle sync" and got an error (attached):
grease maven-publish gradle sync issue.txt

mylib build.gradle.kts:

plugins {
    alias(libs.plugins.android.library)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.thirdparty.grease)
    `maven-publish`
}

android {
    namespace = "com.sample.mylib"
    compileSdk = 35

    defaultConfig {
        minSdk = 24

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles("consumer-rules.pro")
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
}

dependencies {
    greaseTree(project(":core"))
    greaseTree(project(":addons"))
}

publishing {
    publications {
        register<MavenPublication>("release") {
            groupId = "my-company"
            artifactId = "my-fused-library"
            version = "1.0"
        }
    }

    repositories {
        maven {
            name = "myrepo"
            url = uri(layout.buildDirectory.dir("repo"))
        }
    }
}

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