mirror of https://github.com/halo-dev/halo
Support war package.
parent
5149c3da82
commit
109c2e099d
|
@ -2,6 +2,7 @@ plugins {
|
|||
id 'org.springframework.boot' version '2.1.3.RELEASE'
|
||||
id "io.freefair.lombok" version "3.1.4"
|
||||
id 'java'
|
||||
id 'war'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
|
|
@ -2,6 +2,8 @@ package run.halo.app;
|
|||
|
||||
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.data.jpa.repository.config.EnableJpaAuditing;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
@ -21,7 +23,7 @@ import run.halo.app.repository.base.BaseRepositoryImpl;
|
|||
@EnableScheduling
|
||||
@EnableAsync
|
||||
@EnableJpaRepositories(basePackages = "run.halo.app.repository", repositoryBaseClass = BaseRepositoryImpl.class)
|
||||
public class Application {
|
||||
public class Application extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Customize the spring config location
|
||||
|
@ -30,4 +32,10 @@ public class Application {
|
|||
// Run application
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
System.setProperty("spring.config.additional-location", "file:${user.home}/.halo/,file:${user.home}/halo-dev/");
|
||||
return application.sources(Application.class);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue