Skip to content

Commit 5167d73

Browse files
committed
fix: output attestation in JSON Line format
1 parent f005ea1 commit 5167d73

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/apache/commons/release/plugin/mojos/BuildAttestationMojo.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
public class BuildAttestationMojo extends AbstractMojo {
7474

7575
/** The file extension for in-toto attestation files. */
76-
private static final String ATTESTATION_EXTENSION = "intoto.json";
76+
private static final String ATTESTATION_EXTENSION = "intoto.jsonl";
7777

7878
/** Shared Jackson object mapper for serializing attestation statements. */
7979
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
@@ -237,7 +237,8 @@ private void writeStatement(final Statement statement) throws MojoExecutionExcep
237237
final Path artifactPath = outputPath.resolve(ArtifactUtils.getFileName(mainArtifact, ATTESTATION_EXTENSION));
238238
getLog().info("Writing attestation statement to: " + artifactPath);
239239
try (OutputStream os = Files.newOutputStream(artifactPath)) {
240-
OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValue(os, statement);
240+
OBJECT_MAPPER.writeValue(os, statement);
241+
os.write('\n');
241242
} catch (IOException e) {
242243
throw new MojoExecutionException("Could not write attestation statement to: " + artifactPath, e);
243244
}

0 commit comments

Comments
 (0)