File tree Expand file tree Collapse file tree
java/com/github/datagenerator/init Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8484 <groupId >org.springframework.boot</groupId >
8585 <artifactId >spring-boot-maven-plugin</artifactId >
8686 <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 >
9095 </plugin >
9196
9297 <plugin >
Original file line number Diff line number Diff line change 77import org .springframework .beans .factory .annotation .Value ;
88import org .springframework .boot .ApplicationArguments ;
99import org .springframework .boot .ApplicationRunner ;
10+ import org .springframework .boot .SpringApplication ;
11+ import org .springframework .context .ApplicationContext ;
1012import org .springframework .stereotype .Component ;
1113import org .springframework .util .StopWatch ;
1214import java .io .File ;
@@ -23,6 +25,9 @@ public class ApplicationInitializer implements ApplicationRunner {
2325 @ Value ("${datagen.out.path}" )
2426 private String outputPath ;
2527
28+ @ Autowired
29+ private ApplicationContext applicationContext ;
30+
2631 @ Override
2732 public void run (ApplicationArguments args ) throws Exception {
2833 LOGGER .info ("============Starting the application" );
@@ -36,9 +41,10 @@ public void run(ApplicationArguments args) throws Exception {
3641 File outFile = new File (outputPath );
3742 FileUtils .writeLines (outFile , StandardCharsets .UTF_8 .name (), data );
3843 processWatch .stop ();
44+
3945 LOGGER .info ("Took {} seconds" ,processWatch .getTotalTimeSeconds ());
4046
4147 LOGGER .info ("============Done generating data" );
42- LOGGER . info ( "DATA===== \n {}" , data );
48+ SpringApplication . exit ( applicationContext ,()-> 0 );
4349 }
4450}
Original file line number Diff line number Diff line change 11datagen.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