Maven - Suppress [WARNING] JAR will be empty - no content was marked for inclusion in pom.xml

前端 未结 6 1225
再見小時候
再見小時候 2021-02-12 21:16

My maven project intentionally only needs src/test/java and src/test/resources. After removing src/main/* folders, the expected w

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 21:42

    The warning is actually based on whether it can find the configured - by default target\classes.

    This means one simple way to bypass the warning is to point it at another deliberately empty directory:

    
        
            
                maven-jar-plugin
                
                    dummy
                
            
        
    
    

    Alternatively, to avoid the need for the empty directory, exclude everything from another directory:

            
                maven-jar-plugin
                
                    src
                    
                        **
                    
                
            
    

提交回复
热议问题