public/manifest-license/java
Package manifest declares the license
Implements public/manifest-license for java.
| Severity | info |
| Tiers | 1 |
| Stacks | java |
| Scope | each |
| Kind | expr |
| Source | library v0.6.0 |
| Selected by | fleetlint-recommended@v0.6.0 |
Requirement
A Maven project lists <licenses> in pom.xml; a Gradle build that publishes with maven-publish sets pom { licenses { license { ... } } } (in the build or a convention plugin). Builds that publish nothing are not checked.
Why
Registries, SBOM tools and license checkers read the manifest, not the LICENSE file.
Capability applies when
repo.publicCheck
(!file("pom.xml") || text("pom.xml").contains("<licenses>")) && (grep("**/build.gradle*", "maven-publish").size() == 0
|| (glob("**/*.gradle*") + glob("buildSrc/**/*.kt") + glob("build-logic/**/*.kt")).exists(f, text(f).matches(r'\blicenses?\s*\{')))Fix
Add <licenses><license><name>SPDX-id</name><url>...</url></license></licenses> to pom.xml, or pom { licenses { license { name.set("SPDX-id") } } } to the Gradle publication.
Agent instruction: Set the manifest’s license field to the SPDX identifier matching the LICENSE file; ask if the LICENSE text is not a recognised license.
A finding of this rule points at the file (["pom.xml", "build.gradle.kts", "build.gradle"].filter(f, file(f)) + ["pom.xml"])[0] yields.
Sources
- https://spdx.org/licenses/ (spec)
- https://fleetlint.org/baseline/#public-repositories (convention)
- https://maven.apache.org/pom.html (spec, Licenses)
- https://docs.gradle.org/current/userguide/publishing_maven.html (spec)
- https://fleetlint.org/stacks/#java
Generated by fleetlint docs from catalog v0.6.0.