conditionally execute maven plugins

后端 未结 2 1042
感动是毒
感动是毒 2020-12-18 18:15

I have some Maven plugins configured in my pom.xml. I only want to execute these plugins if the tests are being run (tests may be skipped using either -Dmaven.test.ski

2条回答
  •  没有蜡笔的小新
    2020-12-18 18:48

    You can use profile with special activation conditions like this:

    
      ...
      
        
          my-test-plugins
    
          
            !maven.test.skip
            !skipTests
          
          
            
    
          
    
            
          
        
      
    
    

    More info you can find here:

    http://books.sonatype.com/mvnref-book/reference/profiles-sect-activation.html

提交回复
热议问题