Skip to content

packageSupplier with a leading space errors with spdx sboms require a version but project #145

Description

@bric3

In the following config, I made a typo and inserted a space before Person

packageSupplier.set(" Person: Brice Dutheil")

The full error

> Task :jufmt-lib:spdxSbomForJufmtLibRelease FAILED
spdx sboms require a version but project: jufmt-lib has no specified version

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jufmt-lib:spdxSbomForJufmtLibRelease'.
> org.spdx.library.InvalidSPDXAnalysisException: Value must start with one of NOASSERTION, Person:, Organization:

It seems that either the plugin doesn't trim properly the value to be inserted, and/or the error reporting is wrong.

Full config
spdxSbom {
    targets {
        // create a target named "release",
        // this is used for the task name (spdxSbomFor<SBOM name>)
        // and output file (<SBOM name>.spdx.json)
        create("jufmtLibRelease") {
            // configure here
            
            configurations.set(listOf("compileClasspath")) // compilationClasspath
            scm {
                tool.set("git")
                uri.set("https://github.com/bric3/jufmt.git")
                revision.set(
                    providers.environmentVariable("GITHUB_SHA")
                        .orElse(providers.of(GitHeadSource::class) {})
                )
            }
            document {
                name.set("jufmt-lib")
                creator.set("Person: Brice Dutheil")
                packageSupplier.set(" Person: Brice Dutheil")
                // NOTE: The namespace URI does not have to be accessible. It is only intended to provide a universally unique ID.
                // Although this property looks like a HTTP URL, it is in fact not. Technically speaking, a URL defined a Location, where as a URI defines an Identifier (i.e. the name by which something is known)
                namespace.set("https://github.com/bric3/jufmt/${UUID.randomUUID()}")
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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