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

Implementation of configuration property excludeBoms is fragile #257

Open
vpavic opened this issue Feb 20, 2023 · 0 comments
Open

Implementation of configuration property excludeBoms is fragile #257

vpavic opened this issue Feb 20, 2023 · 0 comments

Comments

@vpavic
Copy link

vpavic commented Feb 20, 2023

After troubleshooting the plugin behavior with excludeBoms set to true and several BOMs still being present in the report, I've noticed that the logic that determines whether current module is a BOM actually looks only at the module name:

(module.getModuleName().endsWith("-bom") || module.getModuleName() == "bom") &&

This is very fragile and IMO not at all expected with the property being described as If set to true, then all boms will be excluded from the report in the readme.

BOMs that are not named as expected by the plugin are quite common, and the issue can be easily reproduced using something like this:

import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
    id("java")
    id("org.springframework.boot").version("3.0.2")
    id("com.github.jk1.dependency-license-report").version("2.1")
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation(enforcedPlatform(SpringBootPlugin.BOM_COORDINATES))
}

licenseReport {
    excludeBoms = true
}

Running generateLicenseReport will generate a report with org.springframework.boot:spring-boot-dependencies present in the report.

Could you provide a proper implementation of this feature or at the very least clearly describe its limitations?

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

1 participant