Using AWS CodeBuild, I was using a buildspec that was to run an executable JAR file to execute JUnit tests. Here is my buildspec:
As you can see, I am making use of AWS Secrets Manager to get a couple properties that are passed as system variables to the JUnit execution.
When this Build would run it would fail. In the logs I would see the following error:
Answers on Stack Overflow on the “Unable to access jarfile” error mostly talked about access/permission on the JAR file itself. This was not my issue.
In my case, the error was caused because the values I had set in AWS Secrets Manager for the Client ID and Client Secret were not correct. Once I set the correct values, my Build passed!