[英]maven scm does not listen to perforce trigger output
您好Maven / Perforce专家,
我正在尝试为使用Perforce作为VCS的项目实现Maven工件的自动版本控制。 那使我选择了maven-scm-plugin和maven-release-plugin来达到我的目的。 我们在perforce中使用触发器,该触发器检查每个提交的xml内容中是否存在违例。
checkstyle_xml change-content //depot/project/....xml " /p4/triggers/checkstyle-trigger.pl %user% %changelist% /p4"
不幸的是,当我运行命令“ mvn -X -e -B scm:edit release:update-versions scm:checkin”以编辑文件,更新版本并提交给perforce时,maven不遵守perforce触发器的结果并导致构建失败。 但是,您可以看到更改最终将提交给perforce。
使用已启用触发器的XML进行堆栈跟踪
[DEBUG] Sending changelist:
Change: new
Description:
Auto increment pom version during build process. Reviewed by: RE
Files:
//depot/project/pom.xml
[ERROR] Provider message:
[ERROR] Unable to submit
[ERROR] Command output:
[ERROR] Debug: starting trigger script
Change 351157 submitted.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.112s
[INFO] Finished at: Thu Oct 30 14:51:51 PDT 2014
[INFO] Final Memory: 23M/219M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.7:checkin (default-cli) on project phoenix: Command failed.Unable to submit -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.7:checkin (default-cli) on project phoenix: Command failed.Unable to submit
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command failed.Unable to submit
at org.apache.maven.scm.plugin.AbstractScmMojo.checkResult(AbstractScmMojo.java:439)
at org.apache.maven.scm.plugin.CheckinMojo.execute(CheckinMojo.java:83)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
我在本地提交了文件,以确保perforce触发器不会吐出故障状态代码,并且它实际上也返回SUCCESS。 我不确定为什么Maven不会尊重perforce触发器。
p4 –u testuser submit -d "Test" pom.xml
Submitting change 351166.
Locking 1 files ...
edit //depot/project/pom.xml#25
Debug: starting trigger script
Change 351166 submitted.
$ echo $?
0
我用未启用perforce触发器的txt文件测试了一个方案,并且maven将构建结果返回为SUCCESS,因为从技术上讲,它不会通过perforce触发器
使用没有触发的TXT进行堆栈跟踪
[DEBUG] Sending changelist:
Change: new
Description:
Auto increment pom version during build process. Reviewed by: RE
Files:
//depot/phoenix/auto-increment-pom/pom.txt
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.998s
[INFO] Finished at: Thu Oct 30 14:55:04 PDT 2014
[INFO] Final Memory: 18M/216M
[INFO] ------------------------------------------------------------------------
题:
您可以在触发器表中使用排他性语法(路径字段中的前导连字符)来指定某些文件或模式不运行触发器。
“ p4触发器”文档中有一个示例: http : //www.perforce.com/perforce/doc.current/manuals/cmdref/p4_triggers.html
使用这种语法要小心,这有点让人讨厌:
此功能的知识库文章也有更详细的说明: http : //answers.perforce.com/articles/KB_Article/Excluded-Trigger-Paths-Not-Being-Recognized
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.