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 执行成功了!

相关推荐
向阳121829 分钟前
mybatis 动态 SQL
数据库·sql·mybatis
新手小袁_J1 小时前
JDK11下载安装和配置超详细过程
java·spring cloud·jdk·maven·mybatis·jdk11
xlsw_11 小时前
java全栈day20--Web后端实战(Mybatis基础2)
java·开发语言·mybatis
莫名其妙小饼干15 小时前
网上球鞋竞拍系统|Java|SSM|VUE| 前后端分离
java·开发语言·maven·mssql
.生产的驴18 小时前
SpringBoot 对接第三方登录 手机号登录 手机号验证 微信小程序登录 结合Redis SaToken
java·spring boot·redis·后端·缓存·微信小程序·maven
cmdch201718 小时前
Mybatis加密解密查询操作(sql前),where要传入加密后的字段时遇到的问题
数据库·sql·mybatis
秋恬意21 小时前
什么是MyBatis
mybatis
CodeChampion21 小时前
60.基于SSM的个人网站的设计与实现(项目 + 论文)
java·vue.js·mysql·spring·elementui·node.js·mybatis
全栈老实人_2 天前
时间管理系统|Java|SSM|JSP|
java·开发语言·tomcat·maven
Zhu_S W2 天前
SpringBoot项目的创建方式(五种)
java·spring boot·后端·maven·idea