Maven离线模式打包
背景:
最近由于公司关闭了外网环境,所以需要把maven打包方式改为在本地仓库离线打包。
1、修改maven配置文件:
localRepository改为本地仓库位置
D:\WorkSpace\WorkSoft\maven-repository\iwhalecloud-repository\business
mirrors同时改为本地仓库位置,把其余在线的镜像地址给注释掉
central central file://D:/WorkSpace/WorkSoft/maven-repository/iwhalecloud-repository/business *
2、pom文件中存在RELEASE版本的改为固定版本
org.jetbrains annotations RELEASE compile
更改为
org.jetbrains annotations 23.0.0 compile
3、在本地仓库中还需删除_remote.repositories文件,打开cmd命令行,切换至仓库目录下执行如下命令
for /r %i in (_remote.repositories) do del %i
4、最终打包命令:
mvn clean package -s "E:\work soft\maven\common_conf\settings_crm_local.xml"
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
