How to echo in Maven without Antrun plugin?

后端 未结 4 1695
日久生厌
日久生厌 2021-02-13 16:23

How can I print to the console while executing a mvn command (in a phase/goal), but not using Maven Antrun plugin?

Why I reject Antrun solutions:

  • The over
4条回答
  •  遇见更好的自我
    2021-02-13 16:51

    You can use Groovy Maven Plugin for this.

                                                             
        org.codehaus.gmaven                       
        groovy-maven-plugin                 
        2.0                                       
                                                         
                                                          
                validate                              
                                                              
                    execute                             
                                                             
                                                      
                                                             
                        log.info('Test message: {}', 'Hello, World!')
                                                            
                                                     
                                                         
                                                        
                                                            
    

    The configuration above will produce the following output:

    [INFO] Test message: Hello, World!
    

提交回复
热议问题