惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
罗磊的独立博客
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
U
Unit 42
C
Check Point Blog
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale Blog

博客园 - runliuv

网易 S9 PRO 椅子 螺丝规格 VISUAL STUDIO 如果查找即带Contains,又带SubAgentId 字样的代码? 屏蔽论坛头像图片 WIN10,WIN11 微信 多开 微信付款码支付:“暂无权限使用该授权码,请联系客服处理” Windows 7虚拟机安装Vmware tools 装不了 WIN7 trea 默认utf-8-bom,.editorconfig 使用 openssl 生成国密 公钥 私钥 公私钥 EC PRIVATE KEY 蓝湾 Q36 手柄 说明书 京东APP 如何查看 京东支付 的交易明细 银行卡 禁用firefox自动更新,149及以上版本 Microsoft SQL Server Enterprise 2025 v17.0 正式发布 ISO 镜像 小米电脑管家 妙享桌面 无法输入数字 建行支付接口,退款时提示:服务端返回异常(HTTP状态码:400)(如果该笔交易为帐务交易,则处理结果不确定,请先核对明细!) windows win10 win11 打开图片、照片慢、卡 微PE 官网 WINPE QKeyMapper runliuv EC版国密SM2私钥解析C#.NET FFmpeg 截取视频 runliuv 麦当劳9.9元早餐活动,到哪儿领取? 2026.03 录 MP3 录制 软件 Audacity PowerShell将我的文档、图片、视频等目录复制备份到D盘 抖音网页发布视频时,如何声明是A创作的? Realtek HD Audio Driver for DCH,这个DCH是什么意思 ? Realtek Audio Control 在微软应用商店地址 WIN10 WIN11 命令快速锁屏 使用PowerShell一键备份我的文档视频图片等 C#.NET MVC 前端JS的AES加密 C#.NET 从国密私钥中提取出(导出)公钥,SM2 重庆银行,国密SM4,自定义算法,C#.NET版
IDEA一个项目多JAR包文件夹
runliuv · 2026-03-19 · via 博客园 - runliuv

1.父工程的 pom.xml(根目录)

image

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <!-- 父工程坐标 -->
    <groupId>org.example</groupId>
    <artifactId>parent-project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging> <!-- 父工程必须是 pom 打包类型 -->
    
    <!-- 声明所有子模块 -->
    <modules>
        <module>dlla</module> <!-- 子模块目录名 -->
        <module>mainexe</module> <!-- 子模块目录名 -->
    </modules>
</project>

2.子模块 dllapom.xml

image

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <!-- 继承父工程 -->
    <parent>
        <groupId>org.example</groupId>
        <artifactId>parent-project</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath> <!-- 父 POM 路径 -->
    </parent>
    
    <modelVersion>4.0.0</modelVersion>
    <artifactId>dlla</artifactId> <!-- 子模块坐标,groupId/version 继承父工程 -->
</project>

如果自带了groupId,要注释掉,会自动继承父类:

<!--  <groupId>org.example</groupId>-->

3.子模块 mainexepom.xml(依赖 dlla

image

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.example</groupId>
        <artifactId>parent-project</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    
    <modelVersion>4.0.0</modelVersion>
    <artifactId>mainexe</artifactId>
    
    <!-- 依赖 dlla 模块 -->
    <dependencies>
        <dependency>
            <groupId>org.example</groupId>
            <artifactId>dlla</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>

4.一键打包所有模块

image

 即可以打包根工程,也可以打包启动工程 mainexe 。