Is there any maven sleep functionality?

后端 未结 2 1971
失恋的感觉
失恋的感觉 2021-02-19 15:32

I have maven profile set for testing where in pre-integration-tests maven starts two jetty servers and afterwards tests are started. The problem I\'ve stumbled into is in the se

2条回答
  •  后悔当初
    2021-02-19 16:00

    You can do it with the help of the maven antrun plugin. Something like this:

    
        org.apache.maven.plugins
        maven-antrun-plugin
        
            
                
            
        
        
            
                sleep-for-a-while
                pre-integration-test
                
                    run
                
            
        
    
    

    EDIT: In case someone will catch this. Based on the comment from jl, tasks have indeed been deprecated and here is the same thing based on using targets instead. Sligthly reorganized but has the same function.

    
        org.apache.maven.plugins
        maven-antrun-plugin
        1.8
        
            
                sleep-for-a-while
                pre-integration-test
                
                    
                        
                    
                
                
                    run
                
            
        
    
    

提交回复
热议问题