maven打包添加本地 jar文件到 war中

第一种:


                org.apache.maven.plugins
                maven-war-plugin
                
                    
                        
                            ${project.basedir}/lib
                            WEB-INF/lib
                            true
                            
                                **/*.jar
                            

                        

                    

                

            

第二种:

1、  添加dependency,重点是:system${pom.basedir}

       
              onbon
              bx06.message
              0.6.0-SNAPSHOT
              system
              ${pom.basedir}/lib/bx06.message-0.6.0-SNAPSHOT.jar
        

2、添加maven-dependency-plugin,重点是

      注:这里compile可能会提示错误,可以不管它。

         
                org.apache.maven.plugins
                maven-dependency-plugin
                3.1.1
                
                    
                        copy-dependencies
                        compile
                        
                            copy-dependencies
                        

                        
                            system
                            ${project.build.directory}/${project.build.finalName}/WEB-INF/lib
                        

                    

                

            

你可能感兴趣的:(maven打包添加本地 jar文件到 war中)