為了提供一個單包易部署的服務器應用,考慮使用Spring Boot,因為其集成了Apache Tomcat,易于運行,免去絕大部分了服務器配置的步驟。
專注于為中小企業(yè)提供成都網(wǎng)站設計、成都做網(wǎng)站服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)定安免費做網(wǎng)站提供優(yōu)質(zhì)的服務。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了上千企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。項目初始化
首先從mvn archetype:generate
中選擇 com.github.mkspcd:simple-webapp
(或其他webapp模版) 模版生成項目結(jié)構(gòu)。
更多關于maven請移步Maven - Users Centre
在pom.xml中添加parent來獲取Spring Boot所需的最小依賴。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.hwding.example</groupId> <artifactId>example</artifactId> <packaging>jar</packaging> <version>0.0.1</version> <name>an example</name> <url>https://github.com/hwding</url> <!-- 添加Spring的Repository以便于添加相關組件 --> <repositories> <repository> <url>http://repo.spring.io/milestone/</url> <id>repo-spring</id> </repository> </repositories> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> </parent> <build> <finalName>example</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <!-- 編譯級別,可選 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <!-- 用于Hibernate4的SQLite3 Dialect --> <dependency> <groupId>com.enigmabridge</groupId> <artifactId>hibernate4-sqlite-dialect</artifactId> <version>0.1.2</version> </dependency> <!-- 用于配置數(shù)據(jù)源 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-dbcp2</artifactId> <version>2.1.1</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> <version>2.2.0-RC1</version> </dependency> <!-- SQLite3 驅(qū)動 --> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.20.0</version> </dependency> </dependencies> </project>
本文標題:使用SpringBoot快速構(gòu)建基于SQLite數(shù)據(jù)源的應用-創(chuàng)新互聯(lián)
文章鏈接:http://bm7419.com/article0/dgosio.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、微信小程序、品牌網(wǎng)站建設、云服務器、網(wǎng)站策劃、標簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容