Unless someone answer this, here's my take....

I'm your typical SVN/CVS developer. Which means I've got this mindset that
says "*scm interaction happens with a remote repository*". But mercurial is
distributed. You have a local repository to interact with (commit, tag,
branch e.t.c). This also means there is no http authentication to get in the
way.

So...

<scm>
          <connection>scm:hg:file:///${basedir}</connection>

 <developerConnection>scm:hg:file:///${basedir}</developerConnection>
</scm>

The advantage in doing this is that if your release is just that "your
release and no one elses" then it stay's local. It doesn't get pushed out to
any other (remote) repository. The disadvantage is that if this is a
shared/atomic release, then after 'mvn release:prepare release:perform: has
done it's thing (locally), you will manually need to push the (local)
changeset (i.e. pom version update commit and tag) out to your remote
repository.

In summary...
1. Use the <scm> configuration above (I think it implies that the pom.xml is
in the root of the repo too)....
2. mvn release:prepare release:perform
3. Push the work the maven release plugin did locally to your remote
repository (same as you normally do for changesets).


Mercurial is awesome!!!!


On Tue, Apr 20, 2010 at 10:15 AM, Andrew Hughes <[email protected]> wrote:

> Hi Again,
>
> I'm trying to use the release plugin with mercurial. For reference I have
> the following in my pom.xml:
>
> <scm>
>   <connection>scm:hg:http://compuglobalhypermeganet.com/hg/project-xyz
> </connection>
> *  <developerConnection>scm:hg:
> http://compuglobalhypermeganet.com/hg/project-xyz</developerConnection>*
>   <url>http://compuglobalhypermeganet.com/hg/project-xyz</url>
> </scm>
>
> The release:prepare successfully executes, however the release:perform
> fails whilst trying to 'push' out to the <developerConnection>. I suspect
> the problem lies with the authentication, but I am unable to find a working
> solution. How can I add creditendials so the <developerConnection> actually
> works?
>
> Cheers
> --AH
>
>
> p.s. here is the error log from the release:perform:
>
> [INFO] Checking in modified POMs...
> [INFO] EXECUTING: cmd.exe /X /C "hg commit --message
> "[maven-release-plugin] prepare release project-xyz-1.0.1"
> D:\Workspace\project-xyz\pom.xml"
> [INFO] EXECUTING: cmd.exe /X /C "hg push
> http://compuglobalhypermeganet.com/hg/project-xyz";
> [ERROR]
> EXECUTION FAILED
>   Execution of cmd : push failed with exit code: -1.
>   Working directory was:
>     D:\Workspace\project-xyz
>   Your Hg installation seems to be valid and complete.
>     Hg version: 1.4.3 (OK)
>
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Unable to commit files
> Provider message:
>
> EXECUTION FAILED
>   Execution of cmd : push failed with exit code: -1.
>   Working directory was:
>     D:\Workspace\project-xyz
>   Your Hg installation seems to be valid and complete.
>     Hg version: 1.4.3 (OK)
>
>
> Command output:
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.BuildFailureException: Unable to commit files
> Provider message:
>
> EXECUTION FAILED
>   Execution of cmd : push failed with exit code: -1.
>   Working directory was:
>     D:\Workspace\project-xyz
>   Your Hg installation seems to be valid and complete.
>     Hg version: 1.4.3 (OK)
>
>
> Command output:
>
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
>         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:284)
>         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(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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.MojoFailureException: Unable to commit
> files
> Provider message:
>
> EXECUTION FAILED
>   Execution of cmd : push failed with exit code: -1.
>   Working directory was:
>     D:\Workspace\project-xyz
>   Your Hg installation seems to be valid and complete.
>     Hg version: 1.4.3 (OK)
>
>
> Command output:
>
>         at
> org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:169)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>         ... 17 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 12 seconds
> [INFO] Finished at: Tue Apr 20 10:05:10 CST 2010
> [INFO] Final Memory: 10M/495M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
>
>

Reply via email to