admin 管理员组

文章数量: 886992

从零搭建若依(Ruoyi

项目地址:

文章目录

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

1. pom.xml修改

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=".0.0"xmlns:xsi=""xsi:schemaLocation=".0.0 .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 "第一个接口";}
}

测试:

本文标签: 从零搭建若依(Ruoyi