How do I recreate command run by Maven's antrun plugin?
I'm using Maven 3.0.3 on Solaris 10. I am using the antrun exec plugin. How do I figure out the command line statement that is actually being run? When running my command (designed to checkout code from the StarTeam version control system), I'm getting a permission denied error, although I have verified my user has proper perms. I would like to run the same command Maven is running from a shell so that I can compare the two commands.
Below is the relevant section from my pom.xml file …
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<configuration>
<tasks>
<!-- Backup CIRQUE_COMPLETE and freeze the backup label -->
开发者_如何学C <exec failonerror="true" executable="stcmd" dir="/opt/StarTeamCP_2009/bin/">
<arg value="label" />
<arg value="-p" />
<arg value="user:@mydomain.com:49201/myco/myco/Technology/nna/mycoUSA/cirquedusoleil" />
<arg value="-vl" />
<arg value="CIRQUE_${env}_COMPLETE" />
<arg value="-nl" />
<arg value="CIRQUE_${env}_COMPLETE_`date +"%Y%m%d-%T"`" />
<arg value="-f" />
<arg value="-r" />
</exec>
<!-- Slide CIRQUE_COMPLETE label up to build label -->
<exec failonerror="true" executable="stcmd" dir="/opt/StarTeamCP_2009/bin/">
<arg value="apply-label" />
<arg value="-p" />
<arg value="user:@mydomain.com:49201/myco/myco/Technology/nna/mycoUSA/cirquedusoleil" />
<arg value="-vl" />
<arg value="${env.BUILD_ID}" />
<arg value="-lbl" />
<arg value="CIRQUE_${env}_COMPLETE" />
<arg value="-is" />
<arg value="*" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
You can run maven with the -X
option. This will give you more (debug) information and it will also run ant with the -debug
option.
Use the 'chmod' tag before 'exec' to guarantee the right to execute the command, as follows:
<chmod file="/opt/StarTeamCP_2009/bin/stcmd" perm="a+x"/>
<exec failonerror="true" executable="stcmd" dir="/opt/StarTeamCP_2009/bin/">
...
</exec>
精彩评论