[
http://jira.codehaus.org/browse/MOJO-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256094#action_256094
]
Sean Flanigan commented on MOJO-1582:
-------------------------------------
How are you handling uncommitted merges? I was thinking of writing a patch for
the Mercurial bug MOJO-1537, which falls over trying to get a timestamp for two
parent revisions.
I've given 1.0-beta-5-SNAPSHOT a try on my hg project. With Mercurial, doCheck
has a problem with relative paths, and the scmBranch code has an NPE.
$ mvn initialize -pl common/flies-common-api -e
...
[INFO] --- buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create (default) @
flies-common-api ---
[INFO] Verifying there are no local modifications ...
[INFO] EXECUTING: /bin/sh -c cd
/opt/notbackedup/sflaniga/src/workspace-flies/root/common/flies-common-api &&
hg status
[INFO] Not a file:
/opt/notbackedup/sflaniga/src/workspace-flies/root/common/flies-common-api/flies-parent/pom.xml.
Ignoring
The correct path for my modified file is
/opt/notbackedup/sflaniga/src/workspace-flies/root/flies-parent/pom.xml. I
think a relative path was used relative to the pom directory, rather than the
hg root directory. cf.
http://mojo.codehaus.org/buildnumber-maven-plugin/hgchangeset-mojo.html#scmDirectory
It has correctly picked up my hg changeset id:
[INFO] Updating project files from SCM: skipped.
[INFO] EXECUTING: /bin/sh -c cd
/opt/notbackedup/sflaniga/src/workspace-flies/root/common/flies-common-api &&
hg id -i
[INFO] Storing buildNumber: ded96be4f76a+ at timestamp: 1297755783185
But then it breaks:
[INFO] EXECUTING: /bin/sh -c cd
/opt/notbackedup/sflaniga/src/workspace-flies/root/common/flies-common-api &&
hg id -i
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.611s
[INFO] Finished at: Tue Feb 15 17:43:04 EST 2011
[INFO] Final Memory: 7M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create (default)
on project flies-common-api: Execution default of goal
org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create failed.
NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create (default)
on project flies-common-api: Execution default of goal
org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create failed.
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
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:616)
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.PluginExecutionException: Execution default
of goal org.codehaus.mojo:buildnumber-maven-plugin:1.0-beta-5-SNAPSHOT:create
failed.
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:116)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at
org.codehaus.mojo.build.CreateMojo.filterBranchFromScmUrl(CreateMojo.java:660)
at org.codehaus.mojo.build.CreateMojo.getScmBranch(CreateMojo.java:654)
at org.codehaus.mojo.build.CreateMojo.execute(CreateMojo.java:464)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Looks like scmUrl is null. I think my scm configuration is okay. (See below.)
My configuration looks like this:
{noformat}
<scm>
<connection>scm:hg:http://flies.googlecode.com/hg/</connection>
<developerConnection>scm:hg:https://flies.googlecode.com/hg/</developerConnection>
<url>http://code.google.com/p/flies/source/browse/</url>
</scm>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-5-SNAPSHOT</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
{noformat}
> Uniform interface/goal for all supported SCM providers
> ------------------------------------------------------
>
> Key: MOJO-1582
> URL: http://jira.codehaus.org/browse/MOJO-1582
> Project: Mojo
> Issue Type: Improvement
> Components: buildnumber
> Affects Versions: buildnumber-maven-plugin-1.0-beta-4
> Reporter: Andreas Sewe
> Assignee: Olivier Lamy
> Fix For: buildnumber-maven-plugin-1.0-beta-5
>
>
> At the moment, there are two goals: {{buildnumber:create}} and
> {{buildnumber:hgchangeset}}. But this is a leftover from MOJO-1432 being
> contributed as a new goal rather than extending the existing one.
> All properties defined by {{buildnumber:create}} ({{buildNumber}},
> {{timeStamp}}, and {{buildScmBranch}}) are meaningful for Mercurial (and
> possibly other SCMs) as well. Why do they have to be called differently
> ({{changeSet}} and {{changeSetDate}})? This way one has to remember to change
> the plugin configuration when one switches to another SCM (which shouldn't
> IMHO require changes beyond the {{<scm>}} element). This is particularly
> annoying as one cannot simply configure the {{buildnumber-maven-plugin}} in
> an organisational parent POM, if some of the organisation's child projects
> use one SCM and some use another.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email