Skip to content

Commit 16f2aad

Browse files
committed
[WIP]
1 parent 31bf91a commit 16f2aad

File tree

2 files changed

+29
-6
lines changed
  • labs/lab-1-replatform/springboot2-lambda
  • workshop/content/replatform/springboot2-lambda

2 files changed

+29
-6
lines changed

labs/lab-1-replatform/springboot2-lambda/pom.xml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</dependencies>
9292

9393
<build>
94-
<finalName>${project.artifactId}</finalName>
94+
<finalName>app</finalName>
9595

9696
<plugins>
9797
<plugin>
@@ -101,15 +101,25 @@
101101
</plugin>
102102

103103
<plugin>
104-
<groupId>org.springframework.boot</groupId>
105-
<artifactId>spring-boot-maven-plugin</artifactId>
106-
<version>2.2.1.RELEASE</version>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-shade-plugin</artifactId>
106+
<version>3.2.1</version>
107+
<configuration>
108+
<createDependencyReducedPom>false</createDependencyReducedPom>
109+
</configuration>
107110
<executions>
108111
<execution>
109-
<id>repackage</id>
112+
<phase>package</phase>
110113
<goals>
111-
<goal>repackage</goal>
114+
<goal>shade</goal>
112115
</goals>
116+
<configuration>
117+
<artifactSet>
118+
<excludes>
119+
<exclude>org.apache.tomcat.embed:*</exclude>
120+
</excludes>
121+
</artifactSet>
122+
</configuration>
113123
</execution>
114124
</executions>
115125
</plugin>

workshop/content/replatform/springboot2-lambda/_index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ ls -lh lab-1-replatform/springboot2-lambda/target/springboot2-lambda.jar
1515

1616
It will report a package size of **39 MB**.
1717

18+
To be able to run your function locally to analyse it in more detail, export your `AWS_REGION` as following:
19+
20+
```bash
21+
export AWS_REGION=$(aws --profile default configure get region)
22+
```
23+
24+
To determine the number of classes which gets loaded to execute your function, run the following command in the bash window in your AWS Cloud9 IDE. Each application contains a helper Main class which invokes your AWS Lambda function locally:
25+
26+
```bash
27+
# Java 8
28+
java -cp lab-1-replatform/dagger2-lambda/target/app.jar -verbose:class com.aws.samples.petclinic.Main | grep '\[Loaded' | wc -l
29+
```
30+
1831
## Deploy The Application
1932

2033
To deploy the application, run the following command. It also exports the service endpoint url and the function ARN as environment variables for easy access:

0 commit comments

Comments
 (0)