认证服务:专门负责用户登录、注册、账号注销等后端功能。

新建认证服务

修改最顶端的 ServerURL 来配置为阿里云的 Spring Boot 初始化器:http://start.aliyun.com ,这样才会在后续依赖选择中搜索阿里的模块。

按照之前父模块的部分配置版本。

最终结果:

删掉一些无关紧要的文件,包括:

  • static 文件夹
  • .gitignore
  • HELP.md

配置 pom

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <!-- 指定父项目 -->
    <parent>
        <groupId>com.quanxiaoha</groupId>
        <artifactId>xiaohashu</artifactId>
        <version>${revision}</version>
    </parent>
 
    <!-- 指定打包方式 -->
    <packaging>jar</packaging>
 
    <artifactId>xiaohashu-auth</artifactId>
    <name>${project.artifactId}</name>
    <description>小哈书:认证服务(负责处理用户登录、注册、账号注销等)</description>
 
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
 
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
 
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
 
</project>
 
 

当然也记得修改父模块的 pom 进行注册,不然会找不到组。

创建完成后进行 Maven-clean 和 Maven-package 测试通过即可。