Making maven copy additional files inside the build jar (not resources but any file inside any package)?

后端 未结 3 1711
深忆病人
深忆病人 2020-12-18 04:21

I have a package org.myapp.mypackage with some ruby files (*.rb) and I need to include them in the generated build jar in the same package

3条回答
  •  失恋的感觉
    2020-12-18 04:32

    Not sure if i understood the problem correctly, but if your Ruby files are packaged by maven and declared as a dependency, you can use the shade plugin to include the contents into the resulting jar file:

    
        org.apache.maven.plugins
        maven-shade-plugin
        1.4
        
            
                package
                
                    shade
                
                
                    
                        
                            org.myapp.mypackage:mypackage
                        
                    
                    
                        
                            org.myapp.mypackage:mypackage
                            
                                org/my/package/*.rb
                            
                        
                    
                
            
        
    
    

提交回复
热议问题