Skip to content

Instantly share code, notes, and snippets.

@antmdvs
Created May 3, 2021 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antmdvs/19921717c50d117c93a9b02ef1e8b79e to your computer and use it in GitHub Desktop.
Save antmdvs/19921717c50d117c93a9b02ef1e8b79e to your computer and use it in GitHub Desktop.

sam build was resulting in this error:

Building codeuri: C:\code\AwsToolkitJava runtime: None metadata: {'DockerTag': 'java11-maven-v1', 'DockerContext': 'C:\\code\\AwsToolkitJava\\HelloWorldFunction', 'Dockerfile': 'Dockerfile'} functions: ['HelloWorldFunction']
Building image for HelloWorldFunction function
Setting DockerBuildArgs: {} for HelloWorldFunction function
Step 1/10 : FROM amd64/maven as build-image
 ---> 0615804734cc
Step 2/10 : WORKDIR "/task"
 ---> Using cache
 ---> 3aec61e18097
Step 3/10 : COPY src/ src/
 ---> Using cache
 ---> 6ff361bb2250
Step 4/10 : COPY pom.xml ./
 ---> Using cache
 ---> a25a90b7c04c
Step 5/10 : RUN mvn -q clean install
 ---> Running in a598dc9aa3f9
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project HelloWorld: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x7ec95456) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x7ec95456 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Build Failed
Error: HelloWorldFunction failed to build: The command '/bin/sh -c mvn -q clean install' returned a non-zero code: 1

Updating the lombok version to 1.18.20 resolved the issue.

See also:

projectlombok/lombok#2681 projectlombok/lombok#2681 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment