Skip to content

Commit 1ace65c

Browse files
committed
fix: disable Jackson auto-close option
1 parent 5167d73 commit 1ace65c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import javax.inject.Inject;
3535

36+
import com.fasterxml.jackson.core.JsonGenerator;
3637
import com.fasterxml.jackson.databind.ObjectMapper;
3738
import com.fasterxml.jackson.databind.SerializationFeature;
3839
import org.apache.commons.release.plugin.internal.ArtifactUtils;
@@ -81,6 +82,7 @@ public class BuildAttestationMojo extends AbstractMojo {
8182
static {
8283
OBJECT_MAPPER.findAndRegisterModules();
8384
OBJECT_MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
85+
OBJECT_MAPPER.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
8486
}
8587

8688
/** The SCM connection URL for the current project. */

src/test/java/org/apache/commons/release/plugin/mojos/BuildAttestationMojoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ void attestationTest() throws Exception {
103103
mojo.execute();
104104

105105
Artifact attestation = project.getAttachedArtifacts().stream()
106-
.filter(a -> "intoto.json".equals(a.getType()))
106+
.filter(a -> "intoto.jsonl".equals(a.getType()))
107107
.findFirst()
108-
.orElseThrow(() -> new AssertionError("No intoto.json artifact attached to project"));
108+
.orElseThrow(() -> new AssertionError("No intoto.jsonl artifact attached to project"));
109109
String json = new String(Files.readAllBytes(attestation.getFile().toPath()), StandardCharsets.UTF_8);
110110

111111
String resolvedDeps = "predicate.buildDefinition.resolvedDependencies";

0 commit comments

Comments
 (0)