handle empty username (default to maven.username) and empty passphrase
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115547 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
777731cc46
commit
4ce02d3b68
2 files changed
+7
-7
No files matched your search
@@ -27,7 +27,7 @@ import org.apache.maven.project.Project;
|
||||
* Perform mapping between project's properties and attributes of DeployRequest class.
|
||||
*
|
||||
* @author <a href="mailto:michal.maczka@dimatics.com">Michal Maczka</a>
|
||||
* @version $Id: RepositoryInfoBuilder.java,v 1.4 2004/05/12 12:33:55 evenisse Exp $
|
||||
* @version $Id: RepositoryInfoBuilder.java,v 1.5 2004/06/25 18:19:35 brett Exp $
|
||||
*/
|
||||
public class RepositoryInfoBuilder
|
||||
{
|
||||
@@ -90,6 +90,10 @@ public class RepositoryInfoBuilder
|
||||
|
||||
String proxyPort = (String) project.getContext().getProxyPort();
|
||||
|
||||
if (username == null) {
|
||||
username = (String) project.getContext().getVariable("maven.username");
|
||||
}
|
||||
|
||||
repoInfo.setUserName(username);
|
||||
repoInfo.setPassword(password);
|
||||
repoInfo.setPassphrase(passphrase);
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.jcraft.jsch.UserInfo;
|
||||
* and if that doesn't work then we fall back
|
||||
* to using the login and password
|
||||
*
|
||||
* @version $Id: GenericSshDeployer.java,v 1.10 2004/06/25 13:50:05 brett Exp $
|
||||
* @version $Id: GenericSshDeployer.java,v 1.11 2004/06/25 18:19:35 brett Exp $
|
||||
* @todo still have to account for differing setups for people deploying to
|
||||
* their own sites and to the central repository.
|
||||
* @todo improve exception handling
|
||||
@@ -118,11 +118,7 @@ public abstract class GenericSshDeployer extends AbstractDeployer
|
||||
{
|
||||
if (repoInfo.getPassphrase() == null)
|
||||
{
|
||||
String msg =
|
||||
"Private key provided "
|
||||
+ "without passphrase for repo: "
|
||||
+ repoInfo.getRepositoryAlias();
|
||||
throw new AuthenticationException(msg);
|
||||
repoInfo.setPassphrase("");
|
||||
}
|
||||
|
||||
LOG.info("Using private key: " + privateKey);
|
||||
|
||||
Reference in new issue
Block a user