"echo" 在使用 Maven 时意味着什么?
What does "echo" mean when it comes to using Maven?
我目前正在学习如何使用 Maven,并且遇到了一个叫做 "echo" 的术语。我只是想知道它到底是什么意思?
There are few important concepts related to Maven Lifecycles, which
are worth to mention:
1) When a phase is called via Maven command, for example mvn compile,
only phases up to and including that phase will execute.
2) Different maven goals will be bound to different phases of Maven
lifecycle depending upon the type of packaging (JAR / WAR / EAR).
In the following example, we will attach maven-antrun-plugin:run goal
to few of the phases of Build lifecycle. This will allow us to echo
text messages displaying the phases of the lifecycle.
表示在maven-antrun-plugin:run
执行的ant脚本中使用echo
标签。与maven本身没有直接关系。
echo 是一个 ant 任务,允许将消息打印到控制台 (system.out)
这在使用允许在 maven 构建中执行 ant 任务的 maven-antrun-plugin 时有意义。
它可用于在构建期间打印一些 maven 属性,因为在 maven 中没有内置的方法将值输出到控制台。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.antrun.plugin.version}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Configuration properties :</echo>
<echo>service.endpoint=${service.endpoint}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
我目前正在学习如何使用 Maven,并且遇到了一个叫做 "echo" 的术语。我只是想知道它到底是什么意思?
There are few important concepts related to Maven Lifecycles, which are worth to mention:
1) When a phase is called via Maven command, for example mvn compile, only phases up to and including that phase will execute.
2) Different maven goals will be bound to different phases of Maven lifecycle depending upon the type of packaging (JAR / WAR / EAR).
In the following example, we will attach maven-antrun-plugin:run goal to few of the phases of Build lifecycle. This will allow us to echo text messages displaying the phases of the lifecycle.
表示在maven-antrun-plugin:run
执行的ant脚本中使用echo
标签。与maven本身没有直接关系。
echo 是一个 ant 任务,允许将消息打印到控制台 (system.out)
这在使用允许在 maven 构建中执行 ant 任务的 maven-antrun-plugin 时有意义。
它可用于在构建期间打印一些 maven 属性,因为在 maven 中没有内置的方法将值输出到控制台。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.antrun.plugin.version}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Configuration properties :</echo>
<echo>service.endpoint=${service.endpoint}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>