maven 从特定module(项目)重新开始编译

前言

一般情况下,多module的项目数量过少,可能不需要使用到这个功能,但是当项目过多就很有必要,例如有20个module 编译到最后一个报错了,那重新构建的话 就会从第一个项目再来一遍,是不是很烦躁。

实践

要从特定的某个module(项目)开始重新编译,可以使用Maven的-rf标志(resume from),指定从特定项目重新开始编译。

java 复制代码
# xx 标识从哪个项目开始编译
mvn -U clean package -Dmaven.test.skip=true  -rf :xx

示例 现在项目有个报错

java 复制代码
[INFO] Reactor Summary:
[INFO]
[INFO] datax-all 0.0.1-SNAPSHOT ........................... SUCCESS [ 0.137 s]
[INFO] datax-common 0.0.1-SNAPSHOT ........................ SUCCESS [ 9.469 s]
[INFO] datax-transformer 0.0.1-SNAPSHOT ................... SUCCESS [ 5.269 s]
[INFO] datax-core 0.0.1-SNAPSHOT .......................... FAILURE [ 10.520 s]
[INFO] plugin-rdbms-util 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] mysqlreader 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] drdsreader 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] sqlserverreader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] postgresqlreader 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] kingbaseesreader 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] oraclereader 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] cassandrareader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] oceanbasev10reader 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] obhbasereader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] rdbmsreader 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] odpsreader 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] otsreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] otsstreamreader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] hbase11xreader 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] hbase094xreader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] hbase11xsqlreader 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] hbase20xsqlreader 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] plugin-unstructured-storage-util 0.0.1-SNAPSHOT .... SKIPPED
[INFO] hdfsreader 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] ossreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] ftpreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] txtfilereader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] streamreader 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] clickhousereader 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] mongodbreader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] tdenginewriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] tdenginereader 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] gdbreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] tsdbreader 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] opentsdbreader 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] loghubreader 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] datahubreader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] starrocksreader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] sybasereader 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] dorisreader 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] mysqlwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] starrockswriter 1.1.0 .............................. SKIPPED
[INFO] drdswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] databendwriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] oraclewriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] sqlserverwriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] postgresqlwriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] kingbaseeswriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] odpswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] adswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] oceanbasev10writer 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] obhbasewriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] adbpgwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] hologresjdbcwriter 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] rdbmswriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] hdfswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] osswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] otswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] hbase11xwriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] hbase094xwriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] hbase11xsqlwriter 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] hbase20xsqlwriter 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] kuduwriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] ftpwriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] txtfilewriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] streamwriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] elasticsearchwriter 0.0.1-SNAPSHOT ................. SKIPPED
[INFO] mongodbwriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] ocswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] tsdbwriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] gdbwriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] oscarwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] loghubwriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] datahubwriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] cassandrawriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] clickhousewriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] doriswriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] selectdbwriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] adbmysqlwriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] sybasewriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] neo4jwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] gaussdbreader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] gaussdbwriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] datax-example 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] datax-example-core 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] datax-example-streamreader 0.0.1-SNAPSHOT .......... SKIPPED
[INFO] datax-example-neo4j 0.0.1-SNAPSHOT ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.910 s
[INFO] Finished at: 2024-08-21T15:27:52+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default) on project datax-core: Failed to create assembly: Error creating assembly archive : chmod exit code was: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

可以看到 编译到第四个项目 datax-core 报错了 那我下次想从datax-core开始编译 就可以使用如下命令

java 复制代码
# 这样就会从datax-core 项目开始编译 而不是从第一个项目开始编译 大大减少编译时间
mvn -U clean package assembly:assembly -Dmaven.test.skip=true  -rf :datax-core

good day !!!

相关推荐
尘浮生3 小时前
Java项目实战II基于Spring Boot的光影视频平台(开发文档+数据库+源码)
java·开发语言·数据库·spring boot·后端·maven·intellij-idea
aloha_78911 小时前
从零记录搭建一个干净的mybatis环境
java·笔记·spring·spring cloud·maven·mybatis·springboot
尢词13 小时前
SpringMVC
java·spring·java-ee·tomcat·maven
wrx繁星点点13 小时前
享元模式:高效管理共享对象的设计模式
java·开发语言·spring·设计模式·maven·intellij-idea·享元模式
前 方15 小时前
若依入门案例
java·spring boot·maven
咕哧普拉啦15 小时前
乐尚代驾十订单支付seata、rabbitmq异步消息、redisson延迟队列
java·spring boot·mysql·spring·maven·乐尚代驾·java最新项目
不像程序员的程序媛17 小时前
mybatisgenerator生成mapper时报错
maven·mybatis
移民找老国17 小时前
加拿大移民新风向
java-ee·maven·phpstorm·visual studio code·nio
LUwantAC17 小时前
Java学习路线:Maven(三)继承关系
java·学习·maven
尘浮生21 小时前
Java项目实战II基于Spring Boot的问卷调查系统的设计与实现(开发文档+数据库+源码)
java·开发语言·数据库·spring boot·后端·maven·intellij-idea