1. 插件1:

      
      
          
          
              org.apache.maven.plugins
              maven-jar-plugin
              2.6
              
                  
                      
                          true
                          lib/
                          com.ns.runable.RunnableTest
                      
                  
              
          
          
          
              org.apache.maven.plugins
              maven-dependency-plugin
              2.10
              
                  
                      copy-dependencies
                      package
                      
                          copy-dependencies
                      
                      
                          ${project.build.directory}/lib
                      
                  
              
          
      
      
      
      缺点:生成的jar包太多不便于管理,看下面这个插件:只生成一个包含依赖资源和依赖包的jar;
  • 2 插件2:
    
        kafka_go
        
            
                org.apache.maven.plugins
                maven-assembly-plugin
                3.0.0
                
                    
                        
                            chap2.ProducerDemo
                        
                    
                    
                        jar-with-dependencies
                    
                
                
                    
                        make-assembly
                        
                        package
                        
                        
                            single
                        
                    
                
            
        
    
  • 参见: http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
  • 参见: http://blog.csdn.net/WANGYAN9110/article/details/38646677/
    [待续。。。]