hierynomus / license-gradle-plugin

Manage your license(s)
http://www.javadude.nl
Other
409 stars 114 forks source link

Infinity loop on cyclic dependency #194

Open ueokande opened 3 years ago

ueokande commented 3 years ago

The plugin met infinity loop, and gradle crashed on downloadLicense task when the sub-projects has a cyclic dependency:

$ ./gradlew downloadLicense
> Task :downloadLicenses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':downloadLicenses'.
> java.lang.StackOverflowError (no error message)

There are minimal configurations to reproduce the issue:

// build.gradle.kts
plugins {
    id("org.jetbrains.kotlin.jvm") version "1.5.10"
    id("com.github.hierynomus.license") version "0.16.1"
}

subprojects {
    apply(plugin = "kotlin")
}

allprojects {
    repositories {
        mavenCentral()
    }

    apply(plugin = "com.github.hierynomus.license")
    downloadLicenses {
        dependencyConfiguration = "runtimeClasspath"
    }
}

project(":sub-a") {
    dependencies {
        implementation(project(":sub-b"))
    }
}

project(":sub-b") {
    dependencies {
        implementation(project(":sub-a"))
    }
}
// settings.gradle.kts
include(":sub-a")
include(":sub-b")
fab-10 commented 2 years ago

Could you check if this PR https://github.com/hierynomus/license-gradle-plugin/pull/203 helps?