How to use maven-antrun-plugin for phase exec
Is it possible to use maven-antrun-plugin for the exec phase/goal.
currently I use the following but it does not work:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<开发者_如何学运维;executions>
<execution>
<id>exec</id>
<phase>exec</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target
name='Exec'
>
<exec
executable='${env.COMSPEC}'
osfamily='winnt'
>
<arg
value='/c'
></arg>
<arg
value='src\\main\\scripts\\Exec.cmd'
></arg>
</exec>
<exec
executable='src/main/scripts/Exec.command'
osfamily='unix'
></exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
Of course if anybody knows a way around the ${env.COMSPEC} hack on windows that would be welcome as well.
It looks like the plugin is used to run an arbitrary executable and not an ant task
which should ideally not have OS-specific check.
Perhaps you should look at Exec Maven Plugin?
精彩评论