Skip to content

Commit

Permalink
changing order of run-workflow
Browse files Browse the repository at this point in the history
extracting content of run method into preRun which gets executed before the SpringApplication startup
  • Loading branch information
FabiKo117 committed May 14, 2019
1 parent b8de5fd commit 25ee2e1
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.heigit.bigspatialdata.oshdb.util.tagtranslator.TagTranslator;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.DefaultApplicationArguments;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
Expand All @@ -35,11 +36,15 @@ public static void main(String[] args) {
+ " and '--database.keytables' parameter(s) inside the (nested) "
+ " '-DdbFilePathProperty=' parameter of 'mvn test'.");
}
SpringApplication.run(Application.class, args);
try {
preRun(new DefaultApplicationArguments(args));
SpringApplication.run(Application.class, args);
} catch (Exception e) {
System.exit(1);
}
}

@Override
public void run(ApplicationArguments args) throws Exception {
public static void preRun(ApplicationArguments args) throws Exception {
final String dbProperty = "database.db";
boolean multithreading = true;
boolean caching = false;
Expand Down Expand Up @@ -146,4 +151,7 @@ public void run(ApplicationArguments args) throws Exception {
throw new RuntimeException(e);
}
}

@Override
public void run(ApplicationArguments args) throws Exception {}
}

0 comments on commit 25ee2e1

Please sign in to comment.