springboot项目中swagger不显示已经定义的接口

1、问题:
我的项目是springboot项目
主项目下面有三个模块,如A,B,C,
模块A的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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>sss</artifactId>
        <groupId>com.xxx</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>A</artifactId>

模块B的pom,依赖于模块A,功能:定义swagger配置文件

<?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">
    <parent>
        <artifactId>sss</artifactId>
        <groupId>com.xxx</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>B</artifactId>

    <dependencies>
        <dependency>
            <groupId>com.xxx</groupId>
            <artifactId>A</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <!--swagger-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
        </dependency>
        <!--swagger ui-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
        </dependency>
    </dependencies>
</project>

模块C是核心模块,处理业务,在C中定义一个新街口,始终swagger-ui无法显示这个新接口,
后来经过这些步骤解决了,不知道为什么?
步骤1:我在主项目中使用maven的clean,然后运行项目,发现报错“错误: 找不到或无法加载主类 com.test.serviceApplication”,通过这篇博文https://blog.csdn.net/syr1136877833/article/details/103054336
了解可能是我项目用了几个模块,IDEA无法自动编译
步骤2:删去.ide,重新导入,然后运行,发现项目可以运行了,而且swagger-ui上也显示了新定义的接口

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值