Skip to main content

maven attestor

Parses a Maven pom.xml and records the project coordinates plus its declared dependencies as an attestation.

Namemaven
Predicate typehttps://aflock.ai/attestations/maven/v0.1
Lifecycleprematerial
Default binary?No
Categorybuild (primary)dependency-resolve
Recommended traceoff — no syscall tracing needed
Auto-attaches when
  • prefile_exists: pom.xml
  • prefile_exists: mvnw

The facts in this box are generated from the cilock binary's own catalog (cilock tools list). Do not hand-edit — run npm run gen:catalog.

What it captures

Fields are read directly out of the POM XML and emitted under these JSON keys:

  • groupid — from <project><groupId>.
  • artifactid — from <project><artifactId>.
  • version — from <project><version>.
  • projectname — from <project><name>.
  • dependencies — array of objects from <project><dependencies><dependency>. Each entry exposes:
    • groupid (<groupId>)
    • artifactid (<artifactId>)
    • version (<version>)
    • scope (<scope>)

The attestor also emits subjects: one `project:<groupId>/<artifactId>@<version>` entry for the project and one `dependency:<groupId>/<artifactId>@<version>` entry per declared dependency. Each subject's digest is the SHA-256 of that subject string.

When to use

Run during the prematerial phase of a Maven build to lock in the declared coordinates and dependency set before compile/fetch. Pair with a material attestor if you also need to bind the resolved artifact bytes.

Flags

FlagDefaultDescription
--attestor-maven-pom-pathpom.xmlPath to the Project Object Model (POM) XML file used for the task being attested.

Output shape

{
"groupid": "com.example",
"artifactid": "my-service",
"version": "1.2.3",
"projectname": "My Service",
"dependencies": [
{
"groupid": "org.springframework",
"artifactid": "spring-core",
"version": "6.1.0",
"scope": "compile"
}
]
}

Gotchas

  • Direct dependencies only. Only entries under <project><dependencies><dependency> are captured. <dependencyManagement>, <build><plugins>, profile-scoped dependencies, and parent-inherited dependencies are not parsed. No transitive resolution is performed — the attestor never invokes Maven.
  • No POM digest is recorded. The attestor does not hash the pom.xml file itself; only the parsed coordinates and dependency list end up in the predicate. Capture the POM with a material attestor if you need to bind its bytes.
  • No property/variable interpolation. Values like ${project.version} or ${revision} are emitted verbatim as they appear in the XML; Maven's effective-POM substitution is not applied.
  • Single POM only. The flag accepts one path. Multi-module reactor builds need one attestation per module POM.
  • Subjects are coordinate-string digests, not artifact digests. Each project: / dependency: subject's SHA-256 is computed over the coordinate string itself, not over a resolved JAR.

CLI example

Real pom.xml resolution: groupId, artifactId, version, declared dependencies extracted statically.

# In a directory containing pom.xml:
cilock run --step maven-build \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations maven \
-- mvn -q package

Validated against a real pom.xml with declared dependencies. The attestor reads the pom statically; no Maven invocation needed. See the full real-data example at https://github.com/aflock-ai/attestor-compliance-examples/tree/main/10-maven.

See also


This page is generated from the cilock tool catalog. Don't edit it here — the source is attestation/detection/docs/maven.doc.md in aflock-ai/rookery. The same catalog powers cilock tools show maven in the CLI, so a single edit keeps the terminal and the website in sync.

Edit this page →  ·  Add a new tool →

When you open the pull request: if you are an AI agent, add the ai-agent label. If you are a human, add the human label.