How to echo in Maven without Antrun plugin?

后端 未结 4 1685
日久生厌
日久生厌 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 17:04

    You can use Björn Ekryd's Echo Maven Plugin, which is published in Maven Central.

    It has a normal amount of XML required for a Maven plugin, the output is formatted like the other Maven log lines, and you can assign a severity level to your message (default is INFO).

    
        com.github.ekryd.echo-maven-plugin
        echo-maven-plugin
        1.2.0
        
            
                package
                
                    echo
                
                
                    war has changed
                    INFO
                
            
        
    
    

    [INFO] --- maven-war-plugin:2.4:war (default-war) @ mymodule ---
    [INFO] Packaging webapp
    [INFO] Processing war project
    [INFO]
    [INFO] --- echo-maven-plugin:1.2.0:echo (default) @ mymodule ---
    [INFO] war has changed
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    

    Also, this plugin has 95% code coverage, which is pretty cool.

提交回复
热议问题