这个文章主要是参考:
https://springframework.guru/spring-boot-restful-api-documentation-with-swagger-2/
对于的代码:https://github.com/springframeworkguru/springboot_swagger_example
从girhub上clone到本地,用eclipse ee 导入maven工程,会出现下面错误:
errors exist in required project(s)
Description Resource Path Location Type
Archive for required library: '/home/gs/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.4/jackson-databind-2.9.4.jar' in project 'springboot_swagger_example' cannot be read or is not a valid ZIP file springboot_swagger_example Build path Build Path Problem
解决办法:
(1)https://crunchify.com/cannot-be-read-or-is-not-a-valid-zip-file-how-to-fix-maven-build-path-error-with-corrupted-jar-file/
(2)https://community.talend.com/t5/Design-and-Development/resolved-Errors-in-Workspace-dialogue-Errors-exist-in-required/td-p/71434
就是删除对应的文件夹,然后重新maven -> update project...即可。
结果如图:
分析源码: