从零搭建若依(Ruoyi-Vue)管理系统(3)--初始化搭建admin后台

项目地址:https://github.com/Gang-bb/Gangbb-Vue

1. 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>
    <!---->
    <parent>
        <artifactId>Gangbb-Vue</artifactId>
        <groupId>com.gangbb</groupId>
        <version>1.0.0</version>
    </parent>

    <artifactId>Gangbb-admin</artifactId>

    <description>
        admin后台管理模块
    </description>

    <dependencies>
        <!-- spring-boot-devtools  begin-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <!-- 表示依赖不会传递 -->
            <optional>true</optional>
        </dependency>
        <!-- spring-boot-devtools  end-->

        <!-- SpringBoot Web容器  begin-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- SpringBoot Web容器  end-->

        <!-- SpringBoot yml配置文件编写智能提示  begin-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- SpringBoot yml配置文件编写智能提示  end-->

    </dependencies>

    <!--编译及打包项目配置-->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.1.RELEASE</version>
                <configuration>
                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <!--打成可执行的运行包(.jar .war)-->
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <warName>${project.artifactId}</warName>
                </configuration>
            </plugin>
        </plugins>
        <finalName>${project.artifactId}</finalName>
    </build>


</project>

2. 编写配置文件和启动类

application.yml配置文件:

暂时只有热部署配置

spring:
  devtools:
    # 热部署生效
    add-properties: true
    # 设置重启的目录
    restart:
      additional-paths: src/main/java

springboot整合devtools热部署–我的文章:SpringBoot系列-- SpringBoot之Devtools热部署

3. Application启动类

在这里插入图片描述

@SpringBootApplication
public class AdminApplication {
    public static void main(String[] args)
    {
        SpringApplication.run(AdminApplication.class, args);
    }
}

4.第一个测试Controller

在这里插入图片描述

@RestController
public class TestController {

    @GetMapping("/hello")
    public String Hello(){
        return "第一个接口";
    }
}

测试:

在这里插入图片描述

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值