MAVN阴影插件和AWS lambda

发布于 2025-02-01 00:45:45 字数 1455 浏览 2 评论 0原文

我正在使用下面的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香草可樂 2025-02-08 00:45:45

如果您的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文