How can I display a message in Maven

前端 未结 4 1739
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 12:17

How can I display a message in Maven?

In ant, we do have \"echo\" to display a message, but in maven, how can I do that?

4条回答
  •  抹茶落季
    2021-02-01 12:45

    You can use the antrun plugin:

    
        maven-antrun-plugin
        
            
                generate-resources
                
                    run
                
                
                    
                        Hello world!
                    
                
            
        
    
    

    One issue though is that you have to choose what phase of the build lifecycle to bind this to (my example has the plugin bound to generate-resources). Unlike Ant, you aren't controlling the lifecycle yourself, but rather just binding plugins to certain points in a pre-defined lifecycle. Depending on what you are actually trying to do, this may or may not make sense for your use case.

提交回复
热议问题