「mvn antrun:run」を実行すると、タスクが実行されません..echo タスクがありますが、出力が表示されません..タスクがバインドされているフェーズを実行すると、実行されます..
コマンドラインから具体的にタスクを実行するにはどうすればよいですか?
「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>
実行mvn package
すると、コンソールで次のようになります
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[echo] Hello, maven
[INFO] Executed tasks
を変更phase
して、必要な時点で Ant スクリプトを実行することができます。