[ 
https://jira.codehaus.org/browse/MOJO-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275258#comment-275258
 ] 

Peter B. commented on MOJO-1536:
--------------------------------

thanks a lot for the fix guys! 
I can confirm that ssh upload with <optimize>true</optimize> works for us fine 
with 1.0-beta-4-SNAPSHOT (where with the 1.0-beta-3 it didn't work and caused 
the problem reported).
Our environment is upload from linux to linux machine.

It's by the way a beautiful time-saving feature, in our case upload time 
dropped from 3m:14s to 15s => we saved almost 3 minutes!

Would be great to have 1.0-beta-4 released soon (with this one in) :)

> Optimized wagon plugin is trying to unzip the wrong file
> --------------------------------------------------------
>
>                 Key: MOJO-1536
>                 URL: https://jira.codehaus.org/browse/MOJO-1536
>             Project: Mojo
>          Issue Type: Bug
>          Components: wagon
>            Reporter: Denis Cabasson
>            Assignee: Dan Tran
>            Priority: Critical
>         Attachments: MOJO-1536-patch.txt, MOJO-1536-testcase.zip
>
>
> I am trying to use the optimized version of the wagon plugin to upload a 
> bunch of files (using sshext).
> The wagon plugin is copying the zip allright :
> {quote}
> Executing command: cmd.exe /X /C "pscp -i "****.ppk" -batch wagon18317.zip 
> ***@***:///thefolder/wagon18317.zip"
> {quote}
> but when trying to unzip :
> {quote}
> Executing command: cmd.exe /X /C "plink -i "****.ppk" -batch ****@**** "unzip 
> -o -qq -d / //wagon18317.zip""
> {quote}
> The name of the remote folder has been lost....
> I tracked that in the code to :
> https://svn.codehaus.org/mojo/trunk/mojo/wagon-maven-plugin/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonUpload.java
> {code:java}
>         logger.info( "Uploading " + fileset );
>         File zipFile;
>         zipFile = File.createTempFile( "wagon", ".zip" );
>         try
>         {
>             FileSetManager fileSetManager = new FileSetManager( logger, 
> logger.isDebugEnabled() );
>             String[] files = fileSetManager.getIncludedFiles( fileset );
>             
>             if ( files.length == 0 )
>             {
>                 logger.info( "Nothing to upload.");
>                 return;
>             }
>             
>             logger.info( "Creating " + zipFile + " ..." );
>             createZip( files, zipFile, fileset.getDirectory() );
>             String remoteFileName = zipFile.getName();
>             
>             String remoteFile = zipFile.getName();
>             String remoteDir = fileset.getOutputDirectory();
>             if ( !StringUtils.isBlank( remoteDir ) )
>             {
>                 remoteFile = remoteDir + "/" + remoteFile;
>             }            
>             logger.info( "Uploading " + zipFile + " to " + 
> wagon.getRepository().getUrl() + "/" + remoteFile + " ..." );
>             wagon.put( zipFile, remoteFile );
>             
>             String targetRepoBaseDirectory = 
> wagon.getRepository().getBasedir();  
>             
>             // We use the super quiet option here as all the noise seems to 
> kill/stall the connection
>             String command = "unzip -o -qq -d " + targetRepoBaseDirectory + " 
> " + targetRepoBaseDirectory + "/" + remoteFileName;
>             try
>             {
>                 logger.info( "Remote: " + command );
>                 ( (CommandExecutor) wagon ).executeCommand( command );
>             }
>             finally
>             {
>                 command = "rm -f " + targetRepoBaseDirectory + "/" + 
> remoteFileName ;
>                 logger.info( "Remote: " + command );
> {code}
> Why use *wagon.getRepository().getUrl()* to get the remote directory to 
> upload to, and *wagon.getRepository().getBasedir()* to unzip the zip file? 
> Shouldn't it be the one and same folder at both places?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to