fleetlint Policy for a fleet of repositories
v0.5
Getting started

public/manifest-license/java

Package manifest declares the license

Implements public/manifest-license for java.

Severityinfo
Tiers1
Stacksjava
Scopeeach
Kindexpr
Sourcelibrary v0.2.0
Selected byfleetlint-recommended@v0.2.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.public

Check

(!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.

See: https://fleetlint.org/baseline/#public-repositories, https://fleetlint.org/stacks/#java


Generated by fleetlint docs from catalog v0.2.0.