mirror of https://github.com/halo-dev/halo
parent
f21f5933bf
commit
49486198df
13
build.gradle
13
build.gradle
|
@ -39,10 +39,15 @@ configurations {
|
|||
}
|
||||
}
|
||||
|
||||
bootJar {
|
||||
manifest {
|
||||
attributes("Implementation-Title": "Halo Application",
|
||||
"Implementation-Version": archiveVersion)
|
||||
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
|
||||
// gradle 的 Property Expansion 的占位符 ${..} 与 springboot 的占位符 冲突, springboot 的需要转义 \${..}
|
||||
processResources {
|
||||
filesMatching("application.yaml") {
|
||||
expand(project.properties)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.info.BuildProperties;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -15,8 +16,10 @@ import run.halo.app.cache.AbstractStringCacheStore;
|
|||
import run.halo.app.cache.InMemoryCacheStore;
|
||||
import run.halo.app.cache.LevelCacheStore;
|
||||
import run.halo.app.config.properties.HaloProperties;
|
||||
import run.halo.app.model.support.HaloConst;
|
||||
import run.halo.app.utils.HttpClientUtils;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -34,6 +37,9 @@ public class HaloConfiguration {
|
|||
@Autowired
|
||||
HaloProperties haloProperties;
|
||||
|
||||
@Autowired
|
||||
BuildProperties buildProperties;
|
||||
|
||||
@Bean
|
||||
public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||
builder.failOnEmptyBeans(false);
|
||||
|
@ -70,4 +76,8 @@ public class HaloConfiguration {
|
|||
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
HaloConst.HALO_VERSION = buildProperties.getVersion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,10 +50,6 @@ public class HaloConst {
|
|||
*/
|
||||
public final static String DEFAULT_THEME_ID = "caicai_anatole";
|
||||
|
||||
/**
|
||||
* Version constant. (Available in production environment)
|
||||
*/
|
||||
public static final String HALO_VERSION;
|
||||
/**
|
||||
* Path separator.
|
||||
*/
|
||||
|
@ -143,8 +139,9 @@ public class HaloConst {
|
|||
*/
|
||||
public static String USER_SESSION_KEY = "user_session";
|
||||
|
||||
static {
|
||||
// Set version
|
||||
HALO_VERSION = HaloConst.class.getPackage().getImplementationVersion();
|
||||
}
|
||||
/**
|
||||
* Version constant.
|
||||
*/
|
||||
public static String HALO_VERSION = null;
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ spring:
|
|||
multipart:
|
||||
max-file-size: 10240MB
|
||||
max-request-size: 10240MB
|
||||
location: ${java.io.tmpdir}
|
||||
location: \${java.io.tmpdir}
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
|
@ -48,7 +48,10 @@ logging:
|
|||
level:
|
||||
run.halo.app: INFO
|
||||
file:
|
||||
path: ${user.home}/.halo/logs
|
||||
path: \${user.home}/.halo/logs
|
||||
|
||||
halo:
|
||||
download-timeout: 5m
|
||||
download-timeout: 5m
|
||||
|
||||
application:
|
||||
version: ${version}
|
||||
|
|
Loading…
Reference in New Issue