Skip to content

Commit 5b9ffcc

Browse files
committed
Introduce AOT to base projects of Spring Cloud Stream Samples
1 parent 6029b47 commit 5b9ffcc

File tree

9 files changed

+92
-0
lines changed

9 files changed

+92
-0
lines changed

docs/src/main/asciidoc/batch-starter.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,3 +597,31 @@ Second, this starter lets you configure two properties on the writer.
597597
|===
598598

599599
For more about the configuration options for the `KafkaItemWriter`, see the https://docs.spring.io/spring-batch/docs/4.3.x/api/org/springframework/batch/item/kafka/KafkaItemWriter.html[`KafkaItemWiter` documentation].
600+
601+
=== Spring AOT
602+
When using Spring AOT with Single Step Batch Starter you must set the reader and
603+
writer name properties at compile time (unless you create a bean(s) for the reader and or writer).
604+
To do this you must include the name of the reader and writer that you wish to use as
605+
and argument or environment variable in the boot maven plugin or gradle plugin. For example if
606+
you wish to enable the `FlatFileItemReader` and `FlatFileItemWriter` in Maven it would look like:
607+
608+
```
609+
<plugin>
610+
<groupId>org.springframework.boot</groupId>
611+
<artifactId>spring-boot-maven-plugin</artifactId>
612+
<executions>
613+
<execution>
614+
<id>aot-generate</id>
615+
<goals>
616+
<goal>aot-generate</goal>
617+
</goals>
618+
</execution>
619+
</executions>
620+
<configuration>
621+
<arguments>
622+
<argument>--spring.batch.job.flatfileitemreader.name=foobar</argument>
623+
<argument>--spring.batch.job.flatfileitemwriter.name=fooWriter</argument>
624+
</arguments>
625+
</configuration>
626+
</plugin>
627+
```

spring-cloud-task-samples/batch-events/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@
9696
<plugin>
9797
<groupId>org.springframework.boot</groupId>
9898
<artifactId>spring-boot-maven-plugin</artifactId>
99+
<executions>
100+
<execution>
101+
<id>aot-generate</id>
102+
<goals>
103+
<goal>aot-generate</goal>
104+
</goals>
105+
</execution>
106+
</executions>
99107
</plugin>
100108
<plugin>
101109
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/batch-job/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@
109109
<plugin>
110110
<groupId>org.springframework.boot</groupId>
111111
<artifactId>spring-boot-maven-plugin</artifactId>
112+
<executions>
113+
<execution>
114+
<id>aot-generate</id>
115+
<goals>
116+
<goal>aot-generate</goal>
117+
</goals>
118+
</execution>
119+
</executions>
112120
</plugin>
113121
<plugin>
114122
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/jpa-sample/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@
115115
<plugin>
116116
<groupId>org.springframework.boot</groupId>
117117
<artifactId>spring-boot-maven-plugin</artifactId>
118+
<executions>
119+
<execution>
120+
<id>aot-generate</id>
121+
<goals>
122+
<goal>aot-generate</goal>
123+
</goals>
124+
</execution>
125+
</executions>
118126
</plugin>
119127
<plugin>
120128
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/multiple-datasources/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@
120120
<plugin>
121121
<groupId>org.springframework.boot</groupId>
122122
<artifactId>spring-boot-maven-plugin</artifactId>
123+
<executions>
124+
<execution>
125+
<id>aot-generate</id>
126+
<goals>
127+
<goal>aot-generate</goal>
128+
</goals>
129+
</execution>
130+
</executions>
123131
</plugin>
124132
<plugin>
125133
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/task-events/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
<plugin>
6666
<groupId>org.springframework.boot</groupId>
6767
<artifactId>spring-boot-maven-plugin</artifactId>
68+
<executions>
69+
<execution>
70+
<id>aot-generate</id>
71+
<goals>
72+
<goal>aot-generate</goal>
73+
</goals>
74+
</execution>
75+
</executions>
6876
</plugin>
6977
<plugin>
7078
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/taskprocessor/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@
122122
<plugin>
123123
<groupId>org.springframework.boot</groupId>
124124
<artifactId>spring-boot-maven-plugin</artifactId>
125+
<executions>
126+
<execution>
127+
<id>aot-generate</id>
128+
<goals>
129+
<goal>aot-generate</goal>
130+
</goals>
131+
</execution>
132+
</executions>
125133
</plugin>
126134
<plugin>
127135
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/tasksink/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
<plugin>
8282
<groupId>org.springframework.boot</groupId>
8383
<artifactId>spring-boot-maven-plugin</artifactId>
84+
<executions>
85+
<execution>
86+
<id>aot-generate</id>
87+
<goals>
88+
<goal>aot-generate</goal>
89+
</goals>
90+
</execution>
91+
</executions>
8492
</plugin>
8593
<plugin>
8694
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-task-samples/timestamp/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@
123123
<plugin>
124124
<groupId>org.springframework.boot</groupId>
125125
<artifactId>spring-boot-maven-plugin</artifactId>
126+
<executions>
127+
<execution>
128+
<id>aot-generate</id>
129+
<goals>
130+
<goal>aot-generate</goal>
131+
</goals>
132+
</execution>
133+
</executions>
126134
</plugin>
127135
<plugin>
128136
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)