Log4j2 custom plugins - annotation processing with Maven Assembly Plugin

后端 未结 2 1758
情深已故
情深已故 2021-01-02 08:40

I am not very familiar with Maven, I started using it just yesterday, but I like it. In my project I use Log4j2 library for logging and because of insuffici

2条回答
  •  北海茫月
    2021-01-02 09:19

    Another solution is mentioned in Log4j 2 issue 673. Use maven shade plugin with specific transformer instead of maven assembly plugin.

    
      org.apache.maven.plugins
      maven-shade-plugin
      2.4.3
      
        
          
        
      
      
        
          com.github.edwgiz
          maven-shade-plugin.log4j2-cachefile-transformer
          2.6.1
        
      
      
        
          make-assembly
          package
          
            shade
          
        
      
    
    

    If I understand it accurately, transformer creates Log4j2Plugins.dat file by correctly merging Log4j2Plugins.dat from all dependencies and the main jar, i.e. all plugins will be included.

提交回复
热议问题