You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ev...@apache.org on 2004/05/12 14:33:55 UTC
cvs commit: maven-plugins/artifact/xdocs changes.xml examples.xml properties.xml
evenisse 2004/05/12 05:33:55
Modified: artifact/src/main/org/apache/maven/artifact/deployer
RepositoryInfoBuilder.java
artifact/src/main/org/apache/maven/deploy
RepositoryInfo.java
artifact/src/main/org/apache/maven/deploy/deployers
ScpDeployer.java
artifact/xdocs changes.xml examples.xml properties.xml
Log:
- Fix Scp deployer when it use compress mode.
- Add documentation for the compress mode property.
Revision Changes Path
1.4 +17 -1 maven-plugins/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java
Index: RepositoryInfoBuilder.java
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/src/main/org/apache/maven/artifact/deployer/RepositoryInfoBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RepositoryInfoBuilder.java 2 May 2004 15:04:34 -0000 1.3
+++ RepositoryInfoBuilder.java 12 May 2004 12:33:55 -0000 1.4
@@ -67,6 +67,10 @@
(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 @@
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
1.4 +20 -1 maven-plugins/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java
Index: RepositoryInfo.java
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/src/main/org/apache/maven/deploy/RepositoryInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RepositoryInfo.java 2 May 2004 15:04:34 -0000 1.3
+++ RepositoryInfo.java 12 May 2004 12:33:55 -0000 1.4
@@ -72,6 +72,25 @@
/** 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
1.9 +8 -7 maven-plugins/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java
Index: ScpDeployer.java
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ScpDeployer.java 2 Mar 2004 14:59:31 -0000 1.8
+++ ScpDeployer.java 12 May 2004 12:33:55 -0000 1.9
@@ -48,7 +48,6 @@
/** 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 void init(RepositoryInfo repoInfo) throws AuthenticationException
{
- setDeployNotCompressed(Boolean.getBoolean(COMPRESS));
+ setDeployNotCompressed(!repoInfo.getCompress());
super.init(repoInfo);
}
@@ -104,6 +103,7 @@
*/
public void deploy(DeployRequest request) throws TransferFailedException
{
+ System.out.println("deployNotCompressed=" + deployNotCompressed);
if (deployNotCompressed)
{
doDeployNotCompressed(request);
@@ -112,6 +112,7 @@
{
srcFiles.add(request.getSrcFile());
destFiles.add(request.getDestFile());
+ doDeployCompressed();
}
}
@@ -190,12 +191,12 @@
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 @@
if (getRepositoryInfo().getGroup() != null)
{
String chgrpCmd =
- "chgrp -r"
+ "chgrp -r "
+ getRepositoryInfo().getGroup()
+ " "
+ getRepositoryInfo().getBasedir()
1.13 +2 -0 maven-plugins/artifact/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/xdocs/changes.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- changes.xml 10 May 2004 23:36:34 -0000 1.12
+++ changes.xml 12 May 2004 12:33:55 -0000 1.13
@@ -26,6 +26,8 @@
</properties>
<body>
<release version="1.2-SNAPSHOT" date="in CVS">
+ <action dev="evenisse" type="add">Add documentation for the compress mode property.</action>
+ <action dev="evenisse" type="fix">Fix Scp deployer when it use compress mode.</action>
<action dev="brett" type="fix" issue="MPUBERJAR-5">Add uberjar extension mapping.</action>
</release>
<release version="1.1" date="2004-03-10">
1.6 +1 -0 maven-plugins/artifact/xdocs/examples.xml
Index: examples.xml
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/xdocs/examples.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- examples.xml 4 Mar 2004 17:59:38 -0000 1.5
+++ examples.xml 12 May 2004 12:33:55 -0000 1.6
@@ -55,6 +55,7 @@
maven.repo.R3.directory=repo
maven.repo.R3.group=remote_group
maven.repo.R3.privatekey=/home/michal/.ssh/id_dsa
+maven.repo.R3.compress=true
#settings for repository 'R4'
maven.repo.R4=file://c:\\temp
1.7 +7 -0 maven-plugins/artifact/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/artifact/xdocs/properties.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- properties.xml 8 Apr 2004 00:54:54 -0000 1.6
+++ properties.xml 12 May 2004 12:33:55 -0000 1.7
@@ -121,6 +121,13 @@
</td>
<td>Yes</td>
</tr>
+ <tr>
+ <td>maven.repo.x.compress</td>
+ <td>
+ Used by scp if you want to compress the stream.
+ </td>
+ <td>Yes</td>
+ </tr>
</table>
</section>
<section name="Other properties used">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org