使用IDEA创建springboot项目

1.点击文件->新建->项目

选择创建maven项目

在这里插入图片描述

如图

2.编辑pom.xml文件

1.填写packaging标签,指定项目的类型
项目的类型:pom、jar、war
packing默认是jar类型,pom ---------> 父类型都为pom类型,一般用于父子项目,分模块进行开发,便于扩展
jar ---------> 内部调用或者是作服务使用
war ---------> 需要部署的项目(web项目)

2.导包
写在 dependencies标签下

<?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.rd</groupId>
    <artifactId>graduation_pro</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>jar</packaging>
<!--    对包的版本进行统一控制,比如springboot的包就可以统一使用${spring-boot.version}-->
    <properties>
        <spring-boot.version>2.1.12.RELEASE</spring-boot.version>
        <mybatis-plus.version>3.3.2</mybatis-plus.version>
        <freemarker.version>2.3.30</freemarker.version>
        <mysql.version>5.1.47</mysql.version>
        <lombok.version>1.18.12</lombok.version>
        <common.version>6.0.0</common.version>
        <minio.version>7.1.0</minio.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>
<!--        对数据进行加密-->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>5.2.1.RELEASE</version>
        </dependency>
<!--        json相关的注解-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.10.0</version>
        </dependency>

<!--        mybatis生成器-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>
<!--        使用TableField注解-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-annotation</artifactId>
            <version>${mybatis-plus.version}</version>
        </dependency>
<!--        mybatis-plus模板引擎-->
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>${freemarker.version}</version>
        </dependency>
<!--        mysql数据库-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        </dependency>
<!--        通过注解可以生成构造和set,get方法-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
<!--        提供日志输出功能,可以查看执行的sql语句-->
        <dependency>
            <groupId>org.duracloud</groupId>
            <artifactId>common</artifactId>
            <version>${common.version}</version>
        </dependency>
<!--        用于图片的上传-->
        <dependency>
            <groupId>io.minio</groupId>
            <artifactId>minio</artifactId>
            <version>${minio.version}</version>
        </dependency>


    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>


    </dependencyManagement>


</project>

3.在resource下新建application.yml文件

在这里插入图片描述

4.建启动类

添加@SpringBootApplication注解,这是程序启动的入口

完成如图
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值