如何重新创建 Maven 的 antrun 插件运行的命令?
我在 Solaris 10 上使用 Maven 3.0.3。我使用 antrun exec 插件。如何找出实际正在运行的命令行语句?运行我的命令(旨在从 StarTeam 版本控制系统检出代码)时,我收到权限被拒绝错误,尽管我已验证我的用户具有适当的权限。我想运行 Maven 从 shell 运行的相同命令,以便我可以比较这两个命令。
以下是我的 pom.xml 文件中的相关部分......
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<configuration>
<tasks>
<!-- Backup CIRQUE_COMPLETE and freeze the backup label -->
<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>
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 -->
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
-X
选项运行 Maven。这将为您提供更多(调试)信息,并且还将使用-debug
选项运行 ant。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.在 exec 之前使用 chmod 标签来保证命令的执行权限,如下:
Use the 'chmod' tag before 'exec' to guarantee the right to execute the command, as follows: