为了提供一个单包易部署的服务器应用,考虑使用Spring Boot,因为其集成了Apache Tomcat,易于运行,免去绝大部分了服务器配置的步骤。
项目初始化
首先从mvn archetype:generate
中选择 com.github.mkspcd:simple-webapp
(或其他webapp模版) 模版生成项目结构。
更多关于maven请移步Maven - Users Centre
在pom.xml中添加parent来获取Spring Boot所需的最小依赖。
4.0.0 com.github.hwding.example example jar 0.0.1 an example https://github.com/hwding http://repo.spring.io/milestone/ repo-spring org.springframework.boot spring-boot-starter-parent 1.5.6.RELEASE example org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-compiler-plugin 1.8 1.8 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-data-jpa com.enigmabridge hibernate4-sqlite-dialect 0.1.2 org.apache.commons commons-dbcp2 2.1.1 org.eclipse.persistence javax.persistence 2.2.0-RC1 org.xerial sqlite-jdbc 3.20.0