栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

springboot多模块项目打包(springboot多模块打包部署)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

springboot多模块项目打包(springboot多模块打包部署)

SpringBoot-多模块打包问题解决 1.spring boot 多模块打包方式(jar)
    整理模块之间的依赖关系在idea编译器右边的maven projectects中的项目结构中找的带有root的目录
    先使用Lifecycle -->clean命令进行清理,然后在执行package指令
2. springboot 多模块开发打包问题 1. ‘dependencies.dependency.systemPath’ for com:jna:jar should not point at files within the project directory 自定义引入的jar包打包时无法指向

解决方式:在jar包所在模块下的pom中修改引入方式

原引用方式:

    com
    jna
    1.0.0
    system
    ${project.basedir}/lib/jar/jna.jar


修改后引用方式:

    com
    jna
    1.0.0
    system
    ${pom.basedir}/lib/jar/jna.jar

2. ‘build.plugins.plugin.version’ for org.springframework.boot:spring-boot-maven-plugin is missing 打包版本缺失

解决方式:在父级模块pom下的build中添加版本信息

原方式:

    
        
            org.springframework.boot
            spring-boot-maven-plugin
        
    


修改后:

    
        
            org.springframework.boot
            spring-boot-maven-plugin
            2.2.4.RELEASE
            
                
                    
                        repackage
                    
                
            
        
    

3. Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 没有添加统一平台编码格式

解决方式:在pom中添加统一编码格式


    
        UTF-8
    

4. Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.4.RELEASE:repackage (default) on project fod-api: Execution default of goal 打包指向无法打包

解决方式

1. 父级模块加入一下内容

    
        spring-snapshots
        https://repo.spring.io/snapshot
    
    
        spring-milestones
        https://repo.spring.io/milestone
    


2. 将父级模块打包配置移到web模块(有启动类的模块)中

    
        
            org.springframework.boot
            spring-boot-maven-plugin
            2.2.4.RELEASE
            
                
                    com.fod.fodadmin.FodAdminApplication
                
            
            
                
                    
                        repackage
                    
                
            
        
    

5. spring boot 项目打包成jar后无法调用自定义引入的jar包

解决方式:在build中加入true


        
            
                org.springframework.boot
                spring-boot-maven-plugin
                2.2.4.RELEASE
                
                    true
                    
                        com.fod.fodadmin.FodAdminApplication
                    
                
                
                    
                        
                            repackage
                        
                    
                
            
        
    
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/775405.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号