mybatisgenerator生成mapper时报错

本想使用generator自动生成model和mapper,没想到插件执行的时候报如下错误。

Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project ywq-mybatis-tools: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Plugin org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2 or one of its dependencies could not be resolved: Could not transfer artifact :ywq-mybatis-tools:jar:0.0.3-SNAPSHOT from/to sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

网上搜了下找到了简单的处理办法,在idea的setting里找到maven runner里设置忽略证书检查,添加上-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

具体如下图所示:

改完之后重新执行maven generator插件,依然报错;

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.559 s

[INFO] Finished at: 2024-11-07T14:48:21+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project ywq-mybatis-tools: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Plugin org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2 or one of its dependencies could not be resolved: Failure to find :ywq-mybatis-tools:jar:0.0.3-SNAPSHOT in 公司私服地址/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus public has elapsed or updates are forced -> [Help 1]

好,删除本地仓库里对应的目录(目录里没有jar包)后再次执行还是报错;

Could not find artifact com.bjca.ywq:ywq-mybatis-tools:jar:0.0.3-SNAPSHOT in nexus public (http://nexus.51trust.net/repository/maven-public/)

找同事看他本地有没有对应的jar包,拷到我本地maven仓库下。

终于看到了BUILD SUCCESS 执行成功了!

相关推荐
前 方1 小时前
若依入门案例
java·spring boot·maven
paopaokaka_luck1 小时前
基于Spring Boot+Vue的助农销售平台(协同过滤算法、限流算法、支付宝沙盒支付、实时聊天、图形化分析)
java·spring boot·小程序·毕业设计·mybatis·1024程序员节
咕哧普拉啦1 小时前
乐尚代驾十订单支付seata、rabbitmq异步消息、redisson延迟队列
java·spring boot·mysql·spring·maven·乐尚代驾·java最新项目
cooldream20092 小时前
Spring Boot中集成MyBatis操作数据库详细教程
java·数据库·spring boot·mybatis
移民找老国3 小时前
加拿大移民新风向
java-ee·maven·phpstorm·visual studio code·nio
LUwantAC3 小时前
Java学习路线:Maven(三)继承关系
java·学习·maven
小布布的不6 小时前
MyBatis 返回 Map 或 List<Map>时,时间类型数据,默认为LocalDateTime,响应给前端默认含有‘T‘字符
前端·mybatis·springboot
尘浮生7 小时前
Java项目实战II基于Spring Boot的问卷调查系统的设计与实现(开发文档+数据库+源码)
java·开发语言·数据库·spring boot·后端·maven·intellij-idea
背水8 小时前
Mybatis基于注解的关系查询
mybatis