Commit 57490fa7 by Simon Cheng

支持tomcat发布

parent 15e7ac5b
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/pagehelper"/> <classpathentry combineaccessrules="false" kind="src" path="/pagehelper"/>
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
...@@ -38,5 +38,6 @@ ...@@ -38,5 +38,6 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<!-- 编译时的编码 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties> </properties>
<dependencies> <dependencies>
...@@ -72,6 +75,11 @@ ...@@ -72,6 +75,11 @@
<version>0.6.0</version> <version>0.6.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId> <artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope> <scope>provided</scope>
......
...@@ -4,8 +4,11 @@ import java.util.Properties; ...@@ -4,8 +4,11 @@ import java.util.Properties;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -14,10 +17,15 @@ import com.github.pagehelper.PageHelper; ...@@ -14,10 +17,15 @@ import com.github.pagehelper.PageHelper;
* Application * Application
* *
*/ */
@EntityScan
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
public class Application public class Application extends SpringBootServletInitializer
{ {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main( String[] args ) public static void main( String[] args )
{ {
SpringApplication.run(Application.class, args); SpringApplication.run(Application.class, args);
......
spring.profiles.active=local spring.profiles.active=dev
spring.session.store-type=none spring.session.store-type=none
spring.http.multipart.maxFileSize = 10Mb spring.http.multipart.maxFileSize = 10Mb
spring.http.multipart.maxRequestSize=100Mb spring.http.multipart.maxRequestSize=100Mb
...@@ -9,4 +9,7 @@ spring.http.multipart.maxRequestSize=100Mb ...@@ -9,4 +9,7 @@ spring.http.multipart.maxRequestSize=100Mb
#server.tomcat.uri-encoding=GBK #server.tomcat.uri-encoding=GBK
spring.messages.basename=i18n/messages spring.messages.basename=i18n/messages
spring.messages.encoding=UTF-8 spring.messages.encoding=UTF-8
\ No newline at end of file
spring.jmx.enabled=false
spring.jmx.default-domain=ydapi
\ No newline at end of file
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