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

前端 未结 6 1242
再見小時候
再見小時候 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

    Both solutions suppressed the warning message programmatically.

    Solution 1:

    
    
        org.apache.maven.plugins
        maven-jar-plugin
        3.1.0
        
        
            src
            
                main
            
        
    
    

    Solution 2:

    Since the above essentially created an empty JAR (and I did not really want to include test classes and test resources), I opted to "skip" the JAR creation instead.

    What is the best way to avoid maven-jar?

    
        org.apache.maven.plugins
        maven-jar-plugin
        3.1.0
        
            
                default-jar
                none
            
        
    
    

提交回复
热议问题