Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 2 maven,ant插件,antrun:run_Maven 2_Ant_Maven Plugin - Fatal编程技术网

Maven 2 maven,ant插件,antrun:run

Maven 2 maven,ant插件,antrun:run,maven-2,ant,maven-plugin,Maven 2,Ant,Maven Plugin,执行“mvn antrun:run”时,我的任务不会运行。。我有一个echo任务,但没有显示输出。。当运行任务绑定到的阶段时,它们确实会被执行 如何从命令行具体执行任务?假设类似的内容添加到pom.xml中 <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions

执行“mvn antrun:run”时,我的任务不会运行。。我有一个echo任务,但没有显示输出。。当运行任务绑定到的阶段时,它们确实会被执行


如何从命令行具体执行任务?

假设类似的内容添加到pom.xml中

<build>
   <plugins>
       <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <executions>
            <execution>
              <phase>package</phase><!--Change this to control when it runs -->
              <configuration>
                <tasks>
            <echo  message="Hello, maven"/>
                </tasks>
              </configuration>
              <goals>
                <goal>run</goal><!-- this is to call antrun:run -->
              </goals>
            </execution>
          </executions>
        </plugin>
     </plugins>
  </build>

您可以更改
阶段
,让ant脚本在您需要的任何时候运行。

谢谢您的回答。我使用这个特定的ant任务来部署axis Web服务(使用一个名为AdminClient的程序)。我只能在容器(在本例中为jetty:run)启动后部署它。。那个么哪个阶段是相关的呢?Jetty:run很可能在预集成测试中运行。我会将阶段更改为集成后测试。运行“mvn验证”以运行jetty和ant任务。
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] Hello, maven
[INFO] Executed tasks