You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sdoca sdoca <sd...@shaw.ca> on 2012/01/13 01:19:12 UTC

SCM Plugin - How to Set Up for Release Using Mercurial

Hi,

I am attempting to do a release via the Maven release plugin and am having issues with the SCM config.  I am using Eclipse with m2eclipse installed.  We use Mercurial and on my machine (Win7) I have TortoiseHg installed.  I have a test project that creates a jar.  We make use of a super pom for our projects, so the test project pom does as well.  I have set up this in the super pom:

    <build>
        <plugins>
            ....
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <connectionType>connection</connectionType>
                </configuration>
            </plugin>
        </plugins>
    </build>

My test project pom looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>my.group</groupId>
    <artifactId>TestJar</artifactId>
    <version>1.0-SNAPSHOT</version>
    <parent>
        <groupId>my.group</groupId>
        <artifactId>super-pom</artifactId>
        <version>1.0</version>
    </parent>
    <scm>
        <connection>scm:hg:ssh://our.scm.server:22//path/to/TestJarProject</connection>
    </scm>
</project>

Note that we ssh to our SCM server.  In my settings.xml file, I added this:

<servers>
    ...
    <server>
        <id>our.scm.server</id>
        <username>username</username>
        <password>password</password>
    </server>
</servers>

When I run release:prepare release:perform, a TortoisePlink dialog pops up prompting me for a password.  The dialog box is asking of "@our.scm.server's password".

It appears it is not using the username or password from the settings.xml file which is what I was expecting by adding the server element to it.  Should it be?  I have also tried adding my username to the connection url 

<connection>scm:hg:ssh://username@our.scm.server:22//path/to/TestJarProject</connection>

but am still prompted for an empty username's password.

Once I get this working, I want to be able to use this to do releases in Hudson.  

If somebody could help me figure out how to set this up, it would be most appreciated!  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: SCM Plugin - How to Set Up for Release Using Mercurial

Posted by sdoca sdoca <sd...@shaw.ca>.
Hi Again,

I've set up a Hudson job to do the release but it fails with this error:

[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s)
[INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project TestJar: Cannot prepare the release because you have local modifications : 
[.maven/repo/ca/shaw/eng/nms/nms-super-pom/1.0/_maven.repositories:unknown]
[.maven/repo/ca/shaw/eng/nms/nms-super-pom/1.0/nms-super-pom-1.0.pom:unknown]
[.maven/repo/ca/shaw/eng/nms/nms-super-pom/1.0/nms-super-pom-1.0.pom.sha1:unknown]
... many, many more lines of this nature .....

What local modifications is Maven encountering?  Since the project is being pulled from the repo, the only change I can think of is the update to the pom file (removing SNAPSHOT from the version).  But Maven shouldn't be complaining about this since it made the change itself, no?

----- Original Message -----
From: sdoca sdoca <sd...@shaw.ca>
Date: Thursday, January 12, 2012 5:19 pm
Subject: SCM Plugin - How to Set Up for Release Using Mercurial
To: users@maven.apache.org

> Hi,
> 
> I am attempting to do a release via the Maven release plugin and 
> am having issues with the SCM config.  I am using Eclipse with 
> m2eclipse installed.  We use Mercurial and on my machine 
> (Win7) I have TortoiseHg installed.  I have a test project 
> that creates a jar.  We make use of a super pom for our 
> projects, so the test project pom does as well.  I have set up 
> this in the super pom:
> 
>     <build>
>         <plugins>
>             ....
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-scm-plugin
>                 <version>1.6</version>
>                 <configuration>
>                     <connectionType>connection</connectionType>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
> 
> My test project pom looks like this:
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>my.group</groupId>
>     <artifactId>TestJar
>     <version>1.0-SNAPSHOT</version>
>     <parent>
>         
> <groupId>my.group</groupId>        <artifactId>super-pom
>         
> <version>1.0</version>    </parent>
>     <scm>
>         
> <connection>scm:hg:ssh://our.scm.server:22//path/to/TestJarProject</connection>    </scm>
> </project>
> 
> Note that we ssh to our SCM server.  In my settings.xml 
> file, I added this:
> 
> <servers>
>     ...
>     <server>
>         
> <id>our.scm.server</id>        <username>username</username>
>         
> <password>password</password>    </server>
> </servers>
> 
> When I run release:prepare release:perform, a TortoisePlink 
> dialog pops up prompting me for a password.  The dialog box 
> is asking of "@our.scm.server's password".
> 
> It appears it is not using the username or password from the 
> settings.xml file which is what I was expecting by adding the 
> server element to it.  Should it be?  I have also 
> tried adding my username to the connection url 
> 
> <connection>scm:hg:ssh://username@our.scm.server:22//path/to/TestJarProject</connection>
> 
> but am still prompted for an empty username's password.
> 
> Once I get this working, I want to be able to use this to do 
> releases in Hudson.  
> 
> If somebody could help me figure out how to set this up, it 
> would be most appreciated!  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org