我正在尝试将Java与AWS Lambda结合使用。我创建了一个具有所有依赖项的jar文件(使用maven-assembly- plugin)。上传后,我无法调用lambda。我收到错误消息Calling the Invoke API failed with message: Lambda was not able to unzip the file。jar文件为11 MB。我可以用java -jar
Calling the Invoke API failed with message: Lambda was not able to unzip the file
java -jar
maven-assemply-plugin需要被告知输出a zip而不是a jar。(我什至不知道有什么区别!)
maven-assemply-plugin
zip
jar
将此添加到其配置中:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> ... <configuration> ... <formats> <format>zip</format> </formats> </configuration> </plugin>