Skip to content

Commit 5c3c73d

Browse files
committed
Added indexer to Spring sample for #131.
1 parent f1ccaaa commit 5c3c73d

File tree

1 file changed

+58
-8
lines changed

1 file changed

+58
-8
lines changed

samples/spring/pet-store/pom.xml

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
<maven.compiler.source>1.8</maven.compiler.source>
2828
<maven.compiler.target>1.8</maven.compiler.target>
2929
<spring.version>5.0.3.RELEASE</spring.version>
30+
<junit.version>4.12</junit.version>
31+
<log4j.version>2.8.2</log4j.version>
3032
</properties>
3133

3234
<dependencies>
@@ -42,7 +44,6 @@
4244
<version>1.2.0</version>
4345
</dependency>
4446

45-
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
4647
<dependency>
4748
<groupId>org.springframework</groupId>
4849
<artifactId>spring-webmvc</artifactId>
@@ -55,11 +56,48 @@
5556
<version>${spring.version}</version>
5657
</dependency>
5758

58-
<!-- https://mvnrepository.com/artifact/io.symphonia/lambda-logging -->
59+
<!--
60+
the Spring Context Indexer run an annotation processor at compile time and generates
61+
a META-INF/spring.components file that Spring can use to speed up component scanning at boot time.
62+
For small applications, this doesn't make a big difference. However, for large applications with
63+
complex dependencies this may improve your cold start time significantly.
64+
-->
5965
<dependency>
60-
<groupId>io.symphonia</groupId>
61-
<artifactId>lambda-logging</artifactId>
62-
<version>1.0.1</version>
66+
<groupId>org.springframework</groupId>
67+
<artifactId>spring-context-indexer</artifactId>
68+
<version>${spring.version}</version>
69+
<optional>true</optional>
70+
</dependency>
71+
72+
<dependency>
73+
<groupId>org.apache.logging.log4j</groupId>
74+
<artifactId>log4j-core</artifactId>
75+
<version>${log4j.version}</version>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>org.apache.logging.log4j</groupId>
80+
<artifactId>log4j-api</artifactId>
81+
<version>${log4j.version}</version>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>org.apache.logging.log4j</groupId>
86+
<artifactId>log4j-slf4j-impl</artifactId>
87+
<version>${log4j.version}</version>
88+
</dependency>
89+
90+
<dependency>
91+
<groupId>com.amazonaws</groupId>
92+
<artifactId>aws-lambda-java-log4j2</artifactId>
93+
<version>1.1.0</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>junit</groupId>
98+
<artifactId>junit</artifactId>
99+
<version>${junit.version}</version>
100+
<scope>test</scope>
63101
</dependency>
64102
</dependencies>
65103

@@ -69,17 +107,29 @@
69107
<groupId>org.apache.maven.plugins</groupId>
70108
<artifactId>maven-shade-plugin</artifactId>
71109
<version>2.3</version>
72-
<configuration>
73-
<createDependencyReducedPom>false</createDependencyReducedPom>
74-
</configuration>
75110
<executions>
76111
<execution>
77112
<phase>package</phase>
78113
<goals>
79114
<goal>shade</goal>
80115
</goals>
116+
<configuration>
117+
<createDependencyReducedPom>false</createDependencyReducedPom>
118+
<transformers>
119+
<transformer
120+
implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer">
121+
</transformer>
122+
</transformers>
123+
</configuration>
81124
</execution>
82125
</executions>
126+
<dependencies>
127+
<dependency>
128+
<groupId>com.github.edwgiz</groupId>
129+
<artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
130+
<version>2.8.1</version>
131+
</dependency>
132+
</dependencies>
83133
</plugin>
84134
</plugins>
85135
</build>

0 commit comments

Comments
 (0)