Skip to content

Commit

Permalink
add tomcat support
Browse files Browse the repository at this point in the history
  • Loading branch information
malikzh committed Oct 14, 2022
1 parent 42e0e2b commit 061e0d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.springframework:spring-aspects:5.3.23'
implementation 'org.springframework.retry:spring-retry:1.3.3'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'

// Spock/Mockito
testImplementation 'org.spockframework:spock-core:2.2-groovy-3.0'
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/kz/ncanode/NCANode.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableScheduling;
Expand All @@ -10,7 +12,7 @@
@EnableScheduling
@EnableCaching
@EnableRetry
public class NCANode {
public class NCANode extends SpringBootServletInitializer {
public static void main(String[] args) {
System.out.println(banner());
SpringApplication.run(NCANode.class, args);
Expand All @@ -25,4 +27,9 @@ private static String banner() {
|_____|\\____|`.____ .'|____| |____||_____|\\____|'.__.' '.__.;__]'.__.' \\______.'\s
""";
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(NCANode.class);
}

}

0 comments on commit 061e0d8

Please sign in to comment.