Commit ee9ead26 by fsn

jar方式可以启动

parent 180c094c
......@@ -6,7 +6,7 @@
<groupId>com.stylefeng</groupId>
<artifactId>guns</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<packaging>jar</packaging>
<name>guns</name>
<description>guns 的spring boot版本</description>
......@@ -155,6 +155,13 @@
</plugins>
<resources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**/**</include>
</includes>
<targetPath>/META-INF/resources</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
......
......@@ -28,7 +28,7 @@ public class BeetlProperties {
this.properties.setProperty("DELIMITER_STATEMENT_END", "null");
//classpath 根路径
this.properties.setProperty("RESOURCE.root", "/WEB-INF/view");
this.properties.setProperty("RESOURCE.root", "/");
//是否检测文件变化
this.properties.setProperty("RESOURCE.autoCheck", "true");
......
......@@ -5,6 +5,7 @@ import com.stylefeng.guns.config.properties.BeetlProperties;
import com.stylefeng.guns.core.beetl.BeetlConfiguration;
import com.stylefeng.guns.core.listener.ConfigListener;
import com.stylefeng.guns.core.util.xss.XssFilter;
import org.beetl.core.resource.ClasspathResourceLoader;
import org.beetl.ext.spring.BeetlSpringViewResolver;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
......@@ -28,6 +29,7 @@ public class WebConfig {
@Bean(initMethod = "init")
public BeetlConfiguration beetlConfiguration() {
BeetlConfiguration beetlConfiguration = new BeetlConfiguration();
beetlConfiguration.setResourceLoader(new ClasspathResourceLoader(WebConfig.class.getClassLoader(), "/templates"));
beetlConfiguration.setConfigProperties(BeetlProperties.newInstance());
return beetlConfiguration;
}
......
......@@ -45,7 +45,7 @@ import java.util.Map;
@RequestMapping("/role")
public class RoleController extends BaseController {
private static String PREFIX = "/system/role/";
private static String PREFIX = "/system/role";
@Resource
UserMapper userMapper;
......
......@@ -4,6 +4,9 @@ server:
spring:
profiles:
active: dev
mvc:
view:
prefix: /templates
mybatis-plus:
mapper-locations: classpath*:com/stylefeng/guns/**/mapping/*.xml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment