lucky*阡陌 2021-08-03 09:12 采纳率: 0%
浏览 73

如何给项目打包啊??

一个maven项目,其中包含js代码,五个模块中有一个是
纯js模块,其他四个maven模块,达成一个jar包该怎么打呢??
img
项目结构如图,网上搜的很多都没办法实现

  • 写回答

3条回答 默认 最新

  • Zht_bs 2021-08-03 22:37
    关注

    你们太可怕了一点项目经验都没有吗?
    建立一个主pom文件 ,主pom.xml中加入对应模块引用,将这些子模块的jar编译在本地maven厂库中。

    < modules>

        < module>port-core</module>
        < module>port-security</module>
        <module>port-dictionary</module>
    </modules>
    
    < dependencyManagement>
    
        < dependencies>
            < dependency>
                < groupId>cn.asiic.port< /groupId>
                < artifactId>port-core< /artifactId>
                < version>${portal.version}< /version>
            < /dependency>
    

    。。。。。。。。
    < /dependencies>

    在启动模块的pom.xml中引入本地maven库中编译好的的子模块jar打包到启动包jar中来。
    < dependencies>
    < dependency>
    < groupId>cn.asiic.port< /groupId>
    < artifactId>port-core< /artifactId>
    < /dependency>
    < dependency>
    < groupId>cn.asiic.port< /groupId>
    < artifactId>port-security< /artifactId>
    < /dependency>

    < /dependencies>
    
    < build>
        < plugins>
            < plugin>
                < groupId>org.springframework.boot < /groupId>
                < artifactId>spring-boot-maven-plugin < /artifactId>
            < /plugin>
        < /plugins>
    < /build>
    
    评论

报告相同问题?

问题事件

  • 创建了问题 8月3日

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘