File tree 3 files changed +16
-5
lines changed
java/com/github/datagenerator/init
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 84
84
<groupId >org.springframework.boot</groupId >
85
85
<artifactId >spring-boot-maven-plugin</artifactId >
86
86
<version >2.4.4</version >
87
- <configuration >
88
- <skip >true</skip >
89
- </configuration >
87
+ <executions >
88
+ <execution >
89
+ <id >repackage</id >
90
+ <configuration >
91
+ <classifier >exec</classifier >
92
+ </configuration >
93
+ </execution >
94
+ </executions >
90
95
</plugin >
91
96
92
97
<plugin >
Original file line number Diff line number Diff line change 7
7
import org .springframework .beans .factory .annotation .Value ;
8
8
import org .springframework .boot .ApplicationArguments ;
9
9
import org .springframework .boot .ApplicationRunner ;
10
+ import org .springframework .boot .SpringApplication ;
11
+ import org .springframework .context .ApplicationContext ;
10
12
import org .springframework .stereotype .Component ;
11
13
import org .springframework .util .StopWatch ;
12
14
import java .io .File ;
@@ -23,6 +25,9 @@ public class ApplicationInitializer implements ApplicationRunner {
23
25
@ Value ("${datagen.out.path}" )
24
26
private String outputPath ;
25
27
28
+ @ Autowired
29
+ private ApplicationContext applicationContext ;
30
+
26
31
@ Override
27
32
public void run (ApplicationArguments args ) throws Exception {
28
33
LOGGER .info ("============Starting the application" );
@@ -36,9 +41,10 @@ public void run(ApplicationArguments args) throws Exception {
36
41
File outFile = new File (outputPath );
37
42
FileUtils .writeLines (outFile , StandardCharsets .UTF_8 .name (), data );
38
43
processWatch .stop ();
44
+
39
45
LOGGER .info ("Took {} seconds" ,processWatch .getTotalTimeSeconds ());
40
46
41
47
LOGGER .info ("============Done generating data" );
42
- LOGGER . info ( "DATA===== \n {}" , data );
48
+ SpringApplication . exit ( applicationContext ,()-> 0 );
43
49
}
44
50
}
Original file line number Diff line number Diff line change 1
1
datagen.schema.path =${SCHEMA_IN_PATH}
2
- datagen.out.path =${SCHEMA_OUT_PATH }
2
+ datagen.out.path =${OUT_PATH }
You can’t perform that action at this time.
0 commit comments