Creating Two Executable Jars Using maven-assembly-plugin

前端 未结 1 1564
夕颜
夕颜 2021-01-25 10:34

I have a Maven project and I want to create two executable jar files from it. One will be used interactively by users and a second will be run as a scheduled job that reads the

1条回答
  •  温柔的废话
    2021-01-25 10:51

    So as soon as I posted this, I found this thread:

    Create multiple runnable Jars (with depencies included) from a single Maven project

    This uses a different approach in that it doesn't use two profiles, it uses two executions, as such:

    
        maven-assembly-plugin
        2.4
        
            
                build-publisher
                
                    false
                    
                        
                            fully.qualified.path.Publisher
                        
                    
                    
                        jar-with-dependencies
                    
                    ${project.artifactId}
                
                package
                
                    single
                
            
            
                build-logReader
                
                    false
                    
                        
                            fully.qualified.path.LogReader
                        
                    
                    
                        jar-with-dependencies
                    
                    ${project.artifactId}-logReader
                
                package
                
                    single
                
            
        
    
    

    This seems to be working. The moral of the story seems to be that I don't completely understand profiles or when they should be used.

    0 讨论(0)
提交回复
热议问题