Commit ee9ead26 by fsn

jar方式可以启动

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