MAVN阴影插件和AWS lambda
我正在使用下面的Maven Shade插件来为AWS lambda创建一个JAR
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- Suppress module-info.class warning-->
<exclude>module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
,根据文档,我应该丢弃原始-xxx.jar。 但是14MB源代码对于AWS Lambda来说不是太大吗? 有没有办法减少它。我只使用jackson
aright-artifactName-version.jar = 7kb。 artifactname-version.jar = 14mb
I’m using the maven shade plugin as below to create a jar for aws lambda
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- Suppress module-info.class warning-->
<exclude>module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
As per the documentation, I am supposed to discard the original-xxx.jar.
But is 14MB source code not too big for AWS lambda?
Is there a way to reduce it. I only used AWS core/event/dynamoDB libraries with Jackson
original-artifactName-version.jar = 7KB.
artifactName-version.jar = 14MB
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的Lambda太大,您可以使用Lambda层将所有Lambda的依赖项放在那里。在查找方法。
If your Lambda gets too big you can use a Lambda Layer to put all the Lambda's dependencies there. In this article you can find how to do it.