Gracefully stopping a java process started by maven-antrun-plugin

前端 未结 2 930
栀梦
栀梦 2021-01-14 14:53

This question is a result of an answer to this question from yesterday

run a java application and a web application in a single maven build within a reactor project<

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 15:29

    Having tried various options, I've found that the process-exec-maven-plugin to be best. I realize that the OP is asking about maven-antrun-plugin specifically but that is because of an answer received to a generic question.

    https://github.com/bazaarvoice/maven-process-plugin

    An example of using it to start a nodeJs server which is used as part of integration tests:

    
        com.bazaarvoice.maven.plugins
        process-exec-maven-plugin
        ${process-exec-maven-plugin.version}
        
            
            
                node-server
                pre-integration-test
                
                    start
                
                
                    node-server
                    ../../test-server-dir
                    false
                    http://localhost:3000/
                    
                        node
                        ./app.js
                    
                
            
            
            
                stop-all
                post-integration-test
                
                    stop-all
                
            
        
    
    

提交回复
热议问题