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

相关推荐
jokerest1234 小时前
web——sqliabs靶场——第十三关——报错注入+布尔盲注
mybatis
武子康5 小时前
Java-06 深入浅出 MyBatis - 一对一模型 SqlMapConfig 与 Mapper 详细讲解测试
java·开发语言·数据仓库·sql·mybatis·springboot·springcloud
WindFutrue7 小时前
使用Mybatis向Mysql中的插入Point类型的数据全方位解析
数据库·mysql·mybatis
AiFlutter8 小时前
Java实现简单的搜索引擎
java·搜索引擎·mybatis
天天扭码11 小时前
五天SpringCloud计划——DAY1之mybatis-plus的使用
java·spring cloud·mybatis
丁总学Java12 小时前
Maven项目打包,com.sun.tools.javac.processing
java·maven
疯一样的码农16 小时前
Apache Maven简介
java·maven·apache
Lucky me.18 小时前
本地maven添加jar包
okhttp·maven·jar
疯一样的码农18 小时前
Apache Maven 标准文件目录布局
java·maven·apache
武子康1 天前
Java-05 深入浅出 MyBatis - 配置深入 动态 SQL 参数、循环、片段
java·sql·设计模式·架构·mybatis·代理模式