diff --git a/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java b/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java index be517f44..ca4123e6 100644 --- a/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java +++ b/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java @@ -27,7 +27,7 @@ import org.apache.maven.project.Project; * Perform mapping between project's properties and attributes of DeployRequest class. * * @author Michal Maczka - * @version $Id: RepositoryInfoBuilder.java,v 1.5 2004/06/25 18:19:35 brett Exp $ + * @version $Id: RepositoryInfoBuilder.java,v 1.6 2004/06/25 18:50:38 brett Exp $ */ public class RepositoryInfoBuilder { @@ -82,6 +82,10 @@ public class RepositoryInfoBuilder String remoteGroup = (String) project.getContext().getVariable( "maven.repo." + repository + ".group"); + + String passiveModeOn = + (String) project.getContext().getVariable( + "maven.repo." + repository + ".passiveModeOn"); String proxyHost = (String) project.getContext().getProxyHost(); String proxyUser = (String) project.getContext().getProxyUserName(); @@ -103,6 +107,13 @@ public class RepositoryInfoBuilder repoInfo.setProxyHost(proxyHost); repoInfo.setProxyUserName(proxyUser); repoInfo.setProxyPassword(proxyPassword); + if (passiveModeOn != null) + { + if ("false".equalsIgnoreCase(passiveModeOn)) + { + repoInfo.setPassiveModeOn(false); + } + } if (compress != null) { try diff --git a/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java b/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java index 5245e1a4..3a30ba17 100644 --- a/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java +++ b/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java @@ -23,7 +23,7 @@ package org.apache.maven.deploy; * perform a deployment. * * @author Michal Maczka - * @version $Id: RepositoryInfo.java,v 1.4 2004/05/12 12:33:55 evenisse Exp $ + * @version $Id: RepositoryInfo.java,v 1.5 2004/06/25 18:50:38 brett Exp $ */ public class RepositoryInfo { @@ -33,6 +33,12 @@ public class RepositoryInfo /** The nickname (alias) of the repository*/ private String repositoryAlias; + + /** Indicates if Passive Mode should be used. + * Use passive mode as default because most of us are + * behind firewalls these days. + */ + private boolean passiveModeOn = true; /** URL of the remote host*/ private String url; @@ -366,5 +372,15 @@ public class RepositoryInfo { this.debugOn = debugOn; } + + public boolean isPassiveModeOn() + { + return passiveModeOn; + } + + public void setPassiveModeOn(boolean passiveModeOn) + { + this.passiveModeOn = passiveModeOn; + } } diff --git a/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java b/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java index b014b648..d9c7e4a1 100644 --- a/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java +++ b/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java @@ -42,7 +42,7 @@ import org.apache.maven.deploy.exceptions.TransferFailedException; * * @author Jason van Zyl * @author Michal Maczka - * @version $Id: FtpDeployer.java,v 1.11 2004/06/25 13:50:05 brett Exp $ + * @version $Id: FtpDeployer.java,v 1.12 2004/06/25 18:50:38 brett Exp $ * * @todo review exception handling * @todo don't spool to System.out @@ -124,9 +124,12 @@ public class FtpDeployer extends AbstractDeployer // Set to binary mode. ftp.setFileType(FTP.BINARY_FILE_TYPE); - // Use passive mode as default because most of us are - // behind firewalls these days. - ftp.enterLocalPassiveMode(); + + if(repoInfo.isPassiveModeOn()) + { + ftp.enterLocalPassiveMode(); + } + ftp.changeWorkingDirectory(repoInfo.getBasedir()); } diff --git a/artifact/xdocs/changes.xml b/artifact/xdocs/changes.xml index 848ac95e..a50d9d81 100644 --- a/artifact/xdocs/changes.xml +++ b/artifact/xdocs/changes.xml @@ -26,7 +26,8 @@ - Fix opy-deps when list is empty + Allow non-passive FTP + Fix copy-deps when list is empty Accept empty passphrase to ssh based deployers Default to maven.username if repository username not given Add typeHandler parameter to tags to specify a custom handler