将依赖jar包打包进中的结果。

阅读更多
桌面开发的时候往往希望打包成EXE文件,这样做的第一步就是要将依赖的jar包打包进去。
一般情况下maven不打包的。
需要在pom.xml文件中增加以下代码:

   
   
       
           
                org.apache.maven.plugins
                maven-compiler-plugin
                2.3.2
               
                    1.7
                    1.7
               

           

           
                maven-assembly-plugin
               
                   
                       
                            true
                            换成自己的主类
                       

                   

                   
                        jar-with-dependencies
                   

               

               
                   
                        make-my-jar-with-dependencies
                        package
                       
                            single
                       

                   

               

           
           
       

   

你可能感兴趣的:(maven)