maven 单独构建多模块项目中的单个模块

本文介绍如何使用Maven构建多模块项目中的特定模块及其依赖项,包括使用`-pl`, `-am`, 和 `-amd`选项的具体方法。此外还介绍了如何跳过测试阶段以及如何获取当前激活的Profile。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

maven 单独构建多模块项目中的单个模块, maven选项说明

-pl, --projects
        Build specified reactor projects instead of all projects
-am, --also-make
        If project list is specified, also build projects required by the list
-amd, --also-make-dependents
        If project list is specified, also build projects that depend on projects on the list

单独构建ielong-wx

$ mvn install -pl ielong-wx -am

单独构建ielong-common及依赖ielong-common的模块

$ mvn install -pl ielong-common -am -amd

如何跳过测试

mvn clean package -Pvue -Dmaven.test.skip=true

如何获取当前的profile

@Autowired
private Environment environment;

String profile = environment.getProperty("spring.profiles.active");

if(GlobalConst.PROFILE_PRD.equals(profile)){
}
else {
}

hosts,DNS如何配置

  • hosts: /etc/hosts
  • DNS: /etc/resolv.conf

参考文档

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值