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 69a4258d..410dd3e5 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.3 2004/05/02 15:04:34 vmassol Exp $ + * @version $Id: RepositoryInfoBuilder.java,v 1.4 2004/05/12 12:33:55 evenisse Exp $ */ public class RepositoryInfoBuilder { @@ -67,6 +67,10 @@ public class RepositoryInfoBuilder (String) project.getContext().getVariable( "maven.repo." + repository + ".privatekey"); + String compress = + (String) project.getContext().getVariable( + "maven.repo." + repository + ".compress"); + String dir = (String) project.getContext().getVariable( "maven.repo." + repository + ".directory"); @@ -95,6 +99,18 @@ public class RepositoryInfoBuilder repoInfo.setProxyHost(proxyHost); repoInfo.setProxyUserName(proxyUser); repoInfo.setProxyPassword(proxyPassword); + if (compress != null) + { + try + { + repoInfo.setCompress(new Boolean(compress).booleanValue()); + } + catch (Exception e) + { + throw new MalformedURLException( + "maven.repo." + repository + ".compress should be a boolean"); + } + } if (port != 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 e1e3e265..5245e1a4 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.3 2004/05/02 15:04:34 vmassol Exp $ + * @version $Id: RepositoryInfo.java,v 1.4 2004/05/12 12:33:55 evenisse Exp $ */ public class RepositoryInfo { @@ -72,6 +72,25 @@ public class RepositoryInfo /** basedir */ private String basedir; + + /** compress */ + private boolean compress; + + /** + * @param compress + */ + public void setCompress(boolean compress) + { + this.compress = compress; + } + + /** + * @return + */ + public boolean getCompress() + { + return compress; + } /** * @return diff --git a/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java b/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java index d389fe70..dc6f55ef 100644 --- a/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java +++ b/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java @@ -39,7 +39,7 @@ import java.util.List; * An SSH2/SCP deployer * * @author Michal Maczka - * @version $Revision: 1.8 $ $Date: 2004/03/02 14:59:31 $ + * @version $Revision: 1.9 $ $Date: 2004/05/12 12:33:55 $ */ public class ScpDeployer extends GenericSshDeployer { @@ -48,7 +48,6 @@ public class ScpDeployer extends GenericSshDeployer /** SSH2 Channel name used to communicate with the server*/ public final static String EXEC_CHANNEL = "exec"; - public final static String COMPRESS = "maven.deployer.scp.compress"; /** * I want to have compression by default @@ -95,7 +94,7 @@ public class ScpDeployer extends GenericSshDeployer */ public void init(RepositoryInfo repoInfo) throws AuthenticationException { - setDeployNotCompressed(Boolean.getBoolean(COMPRESS)); + setDeployNotCompressed(!repoInfo.getCompress()); super.init(repoInfo); } @@ -104,6 +103,7 @@ public class ScpDeployer extends GenericSshDeployer */ public void deploy(DeployRequest request) throws TransferFailedException { + System.out.println("deployNotCompressed=" + deployNotCompressed); if (deployNotCompressed) { doDeployNotCompressed(request); @@ -112,6 +112,7 @@ public class ScpDeployer extends GenericSshDeployer { srcFiles.add(request.getSrcFile()); destFiles.add(request.getDestFile()); + doDeployCompressed(); } } @@ -190,12 +191,12 @@ public class ScpDeployer extends GenericSshDeployer doCopy(session, request); String unzipCmd = - "unzip -d -u " - + getRepositoryInfo().getBasedir() - + " " + "unzip -u " + getRepositoryInfo().getBasedir() + "/" + request.getDestFile() + + " -d " + + getRepositoryInfo().getBasedir() + "\n"; executeSimpleCommand(session, unzipCmd); @@ -212,7 +213,7 @@ public class ScpDeployer extends GenericSshDeployer if (getRepositoryInfo().getGroup() != null) { String chgrpCmd = - "chgrp -r" + "chgrp -r " + getRepositoryInfo().getGroup() + " " + getRepositoryInfo().getBasedir() diff --git a/artifact/xdocs/changes.xml b/artifact/xdocs/changes.xml index ba5e1327..9727929d 100644 --- a/artifact/xdocs/changes.xml +++ b/artifact/xdocs/changes.xml @@ -26,6 +26,8 @@