Whole file

awslabs/aws-lambda-builders

The author described this change as Fix #502: Capture Maven stderr in error messages (#822). It counts as a record because the checks below fail on the code as it stood at 051c6ef2f and pass on 8ccbae9b5, with nothing else changed between the two runs.

Fix saved2026-01-20
Sharing licenceApache-2.0 · LICENSE
Change size+4 4

What the code was meant to do, written into the code itself as a save note

Fix #502: Capture Maven stderr in error messages (#822)

The change

2828
2929 def build(self, scratch_dir):
3030 args = ["clean", "install"]
31- ret_code, stdout, _ = self._run(args, scratch_dir)
31+ ret_code, stdout, stderr = self._run(args, scratch_dir)
3232
3333 LOG.debug("Maven logs: %s", decode(stdout))
3434
3535 if ret_code != 0:
36- raise MavenExecutionError(message=decode(stdout))
36+ raise MavenExecutionError(message=decode(stderr))
3737
3838 def copy_dependency(self, scratch_dir):
3939 include_scope = "runtime"
4040 LOG.debug("Running copy_dependency with scope: %s", include_scope)
4141 args = ["dependency:copy-dependencies", f"-DincludeScope={include_scope}", "-Dmdep.prependGroupId=true"]
42- ret_code, stdout, _ = self._run(args, scratch_dir)
42+ ret_code, stdout, stderr = self._run(args, scratch_dir)
4343
4444 if ret_code != 0:
45- raise MavenExecutionError(message=decode(stdout))
45+ raise MavenExecutionError(message=decode(stderr))
4646
4747 def _run(self, args, cwd=None):
4848 p = self.os_utils.popen(

The check that tells the two apart

failpass·tests/unit/workflows/java_maven/test_maven.py::TestSubprocessMaven::test_build_raises_exception_if_retcode_not_0
failpass·tests/unit/workflows/java_maven/test_maven.py::TestSubprocessMaven::test_copy_dependency_raises_exception_if_retcode_not_0

Check file tests/unit/workflows/java_maven/test_maven.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it051c6ef2fd0079190c758f1622af7a68e48eb723
Broken version dated2026-01-16
Moduleaws_lambda_builders.workflows.java_maven.maven
Units changedSubprocessMaven
Fingerprint4c83d6e1295ce5c5
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in awslabs/aws-lambda-builders