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

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

文章目录

    • 1. pom.xml修改
    • 2. 编写配置文件和启动类
    • 3. Application启动类
    • 4.第一个测试Controller

1. pom.xml修改


<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.0modelVersion>
    
    <parent>
        <artifactId>Gangbb-VueartifactId>
        <groupId>com.gangbbgroupId>
        <version>1.0.0version>
    parent>

    <artifactId>Gangbb-adminartifactId>

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

    <dependencies>
        
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <scope>runtimescope>
            
            <optional>trueoptional>
        dependency>
        

        
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
        

        
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-configuration-processorartifactId>
            <optional>trueoptional>
        dependency>
        

    dependencies>

    
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <version>2.1.1.RELEASEversion>
                <configuration>
                    <fork>truefork> 
                configuration>
                <executions>
                    <execution>
                        <goals>
                            
                            <goal>repackagegoal>
                        goals>
                    execution>
                executions>
            plugin>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-war-pluginartifactId>
                <version>3.1.0version>
                <configuration>
                    <failOnMissingWebXml>falsefailOnMissingWebXml>
                    <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启动类

从零搭建若依(Ruoyi-Vue)管理系统(3)--初始化搭建admin后台_第1张图片
@SpringBootApplication
public class AdminApplication {
    public static void main(String[] args)
    {
        SpringApplication.run(AdminApplication.class, args);
    }
}

4.第一个测试Controller

从零搭建若依(Ruoyi-Vue)管理系统(3)--初始化搭建admin后台_第2张图片
@RestController
public class TestController {

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

测试:

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

你可能感兴趣的:(#,从零搭建若依管理系统,java实战开发,spring,boot,spring,java)