2

我已将 Maven2 项目配置为从 Mercurial 存储库(可通过 file:// 协议访问)生成更改日志报告,但目标执行失败并显示以下消息:

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'changelog'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Phobos3 Prototype
[INFO]    task-segment: [changelog:changelog]
[INFO] ------------------------------------------------------------------------
[INFO] [changelog:changelog {execution: default-cli}]
[INFO] Generating changed sets xml to: D:\Documents and Settings\501845922\Workspace\phobos3.prototype\target\changelog.xml
[INFO] EXECUTING: hg log --verbose
[WARNING] Could not figure out: abort: Invalid argument
[ERROR]
EXECUTION FAILED
  Execution of cmd : log failed with exit code: -1.
  Working directory was:
    D:\Documents and Settings\501845922\Workspace\phobos3.prototype
  Your Hg installation seems to be valid and complete.
    Hg version: 1.4.3+20100201 (OK)


[ERROR] Provider message:
[ERROR]
EXECUTION FAILED
  Execution of cmd : log failed with exit code: -1.
  Working directory was:
    D:\Documents and Settings\501845922\Workspace\phobos3.prototype
  Your Hg installation seems to be valid and complete.
    Hg version: 1.4.3+20100201 (OK)


[ERROR] Command output:
[ERROR]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Change Log report generation.

Embedded error: An error has occurred during changelog command :
Command failed.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has occurred in Change Log report generation.
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has occurred in Change Log report generation.
        at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:79)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.apache.maven.reporting.MavenReportException: An error has occurred during changelog command :
        at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:555)
        at org.apache.maven.plugin.changelog.ChangeLogReport.getChangedSets(ChangeLogReport.java:393)
        at org.apache.maven.plugin.changelog.ChangeLogReport.executeReport(ChangeLogReport.java:340)
        at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
        at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
        ... 19 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Command failed.
        at org.apache.maven.plugin.changelog.ChangeLogReport.checkResult(ChangeLogReport.java:705)
        at org.apache.maven.plugin.changelog.ChangeLogReport.generateChangeSetsFromSCM(ChangeLogReport.java:467)
        ... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Apr 29 17:10:06 CEST 2010
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------

我在配置中错过了什么?(希望是配置问题而不是Maven插件相关的bug!:) 我的repository URL好像没问题(插件之前一直抱怨,我修好了),我还设置了解析的日期格式(也一直在抱怨,也固定)。

承诺的 target/changelog.xml 根本没有生成。

Maven 2.2.1 Mercurial 1.4.3 Windows XP SP3

mvn scm:changelog命令提供预期的输出。

感谢您的任何建议,我没有搜索任何内容(也没有搜索;)。

4

1 回答 1

1

我对一个随机项目进行了测试(准确地说是noop):

hg clone https://noop.googlecode.com/hg/ noop

And after configuring the dateFormat of the maven-changelog-plugin in the top pom.xml:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-changelog-plugin</artifactId>
    <configuration>
      <dateFormat>EEE MMM dd hh:mm:ss yyyy Z</dateFormat>
    </configuration>
  </plugin>

I've been able to run mvn changelog:changelog without troubles. My point is that the plugin seems to work for at least one project (chosen randomly :).

I'd really like to know if hg log --verbose behave correctly as the plugin seems to complain about it not running successfully. If it does, could you try to pass the -X option when running Maven and see if you get more useful information.

Also, please provide the content of your <scm> element.

于 2010-04-29T21:36:18.847 回答