PR: MPCHANGELOG-89

Plugin fails with anonymous access and empty password in scm url.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@488860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl
2006-12-20 00:09:04 +00:00
parent d5f32ed53b
commit 4c775b4d7d
3 changed files with 20 additions and 1 deletions

View File

@@ -120,8 +120,19 @@ public final class RepositoryUtils
"cvs local repository connection string doesn't contain five tokens" );
}
}
else if ( ( tokens.length == 7 ) && tokens[2].equals( "pserver" ) && tokens[4].startsWith("@"))
{
String[] newTokens = new String[6];
if ( tokens.length != 6 )
newTokens[0] = tokens[0];
newTokens[1] = tokens[1];
newTokens[2] = tokens[2];
newTokens[3] = tokens[3] + tokens[4];
newTokens[4] = tokens[5];
newTokens[5] = tokens[6];
tokens = newTokens;
}
else if ( tokens.length != 6 )
{
throw new IllegalArgumentException(
"cvs repository connection string doesn't contain six tokens" );

View File

@@ -43,6 +43,13 @@ public class RepositoryTest
assertEquals("Wrong number of tokens split", 6, tokens.length);
}
public void testSplitScmConnectionEmptyPassword()
{
String con = "scm:cvs:pserver:anoncvs:@cvs.apache.org:/cvs/root:module";
String[] tokens = RepositoryUtils.splitSCMConnection(con);
assertEquals("Empty password should be ignored", "anoncvs@cvs.apache.org", tokens[3]);
}
public void testSplitScmConnectionCvsLocal5Tokens()
{
String con = "scm:cvs:local:/cvs/root:module";

View File

@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.10-SNAPSHOT" date="In SVN">
<action dev="ltheussl" type="fix" issue="MPCHANGELOG-89">Plugin fails with anonymous access and empty password in scm url.</action>
<action dev="aheritier" type="update" issue="MAVEN-1769">Upgrade maven-model to version 3.0.2</action>
<action dev="ltheussl" type="add">New property <code>maven.changelog.useDeveloperConnection</code>.</action>
<action dev="ltheussl" type="add" issue="MPCHANGELOG-86" due-to="Christoph Jerolimov">Support time period in MKS changelog parser.</action>