国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > Java > 正文

idea快速搭建springboot項(xiàng)目的操作方法

2024-07-13 10:15:24
字體:
供稿:網(wǎng)友

Spring Boot是由Pivotal團(tuán)隊(duì)提供的全新框架,設(shè)計(jì)目的是用來簡(jiǎn)化新Spring應(yīng)用的初始搭建以及開發(fā)過程。它主要推崇的是'消滅配置',實(shí)現(xiàn)零配置。

那么,如何在idea中創(chuàng)建一個(gè)springboot項(xiàng)目呢?

一.在你建立的工程下創(chuàng)建 Module 選擇Spring initializr創(chuàng)建。

idea,搭建,springboot

二.在Type處選擇: Maven Project(項(xiàng)目的構(gòu)建工具)

idea,搭建,springboot

三.創(chuàng)建依賴時(shí)勾上web,mybatis,mysql(這個(gè)看你個(gè)人需要吧,可以自主選擇)

idea,搭建,springboot

idea,搭建,springboot

建立好的項(xiàng)目結(jié)構(gòu)如下:

idea,搭建,springboot

相對(duì)應(yīng)的pom.xml文件

<?xml version="1.0" encoding="UTF-8"?><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/xsd/maven-4.0.0.xsd">  <modelVersion>4.0.0</modelVersion>  <groupId>com</groupId>  <artifactId>demo</artifactId>  <version>0.0.1-SNAPSHOT</version>  <packaging>jar</packaging>  <name>demo</name>  <description>Demo project for Spring Boot</description>  <parent>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId>    <version>1.5.9.RELEASE</version>    <relativePath/> <!-- lookup parent from repository -->  </parent>  <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>    <java.version>1.8</java.version>  </properties>  <dependencies>    <dependency>      <groupId>org.mybatis.spring.boot</groupId>      <artifactId>mybatis-spring-boot-starter</artifactId>      <version>1.3.1</version>    </dependency>    <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-web</artifactId>    </dependency>    <dependency>      <groupId>mysql</groupId>      <artifactId>mysql-connector-java</artifactId>      <scope>runtime</scope>    </dependency>    <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-test</artifactId>      <scope>test</scope>    </dependency>    <!--c3p0 這是我手動(dòng)引入的 因?yàn)槲倚枰B接數(shù)據(jù)庫(kù)-->    <dependency>      <groupId>com.mchange</groupId>      <artifactId>c3p0</artifactId>      <version>0.9.5.2</version>    </dependency>  </dependencies>  <build>    <plugins>      <plugin>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-maven-plugin</artifactId>      </plugin>    </plugins>  </build></project>

application.yml(項(xiàng)目建城時(shí)這個(gè)application文件的后綴名不叫yml,是官方推薦把后綴改成yml的,好處是代碼有提示)

mybatis: mapper-locations: classpath:mapper/*.xml type-aliases-package: com.demo.pojo#數(shù)據(jù)庫(kù)連接池spring: datasource: username: root password: sasa url: jdbc:mysql://localhost:3306/ssm driver-class-name: com.mysql.jdbc.Driver

啟動(dòng)

idea,搭建,springboot

以上這篇idea快速搭建springboot項(xiàng)目的操作方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持VeVb武林網(wǎng)。


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到JAVA教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 泾川县| 嘉善县| 玉山县| 蓝山县| 洛南县| 泸西县| 台东市| 绵竹市| 从化市| 抚顺县| 旌德县| 建宁县| 吉水县| 仪征市| 铜鼓县| 汉沽区| 敦煌市| 嘉兴市| 乌鲁木齐县| 菏泽市| 高尔夫| 松溪县| 吴忠市| 烟台市| 西畴县| 景洪市| 紫阳县| 中卫市| 凤翔县| 牟定县| 安岳县| 平顶山市| 青河县| 抚远县| 盐山县| 剑河县| 清徐县| 汽车| 新蔡县| 澄迈县| 来宾市|