开发者

Maven write to stdout

开发者 https://www.devze.com 2022-12-25 02:21 出处:网络
Anyone familiar with a w开发者_如何学运维ay how can I can i write something to the stdout from maven.

Anyone familiar with a w开发者_如何学运维ay how can I can i write something to the stdout from maven.

For instance i would like to write a line everytime i start a new module.


I would use the Maven AntRun plugin to echo the message and bind it on the validate phase (the first phase) of the default lifecyle in the parent pom:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <id>entering-module</id>
            <phase>validate</phase>
            <configuration>
              <tasks>
                <echo>Entering module: ${pom.artifactId}</echo>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

This is just an example of course, the message I'm writing here doesn't really add value to what Maven is already providing/doing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号