[
http://jira.codehaus.org/browse/MOJO-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Denis Cabasson updated MOJO-1536:
---------------------------------
Attachment: MOJO-1536-testcase.zip
Hi Dan, and thanks for your reply. Please find the attached test case. You will
just have to change the server name from myServer to whatever Unix server you
have access too.
Basically, when I am executing it :
{quote}
mvn package
{quote}
Here is the system output I get :
{quote}
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building MOJO-1536 test case
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [wagon:upload {execution: upload-website}]
[INFO] Uploading org.apache.maven.shared.model.fileset.file...@68cb6b
[INFO] Creating C:\DOCUME~1\cabaden\LOCALS~1\Temp\wagon58329.zip ...
[INFO] Uploading C:\DOCUME~1\cabaden\LOCALS~1\Temp\wagon58329.zip to
scpexe://myServer///this/is/a/test/directory//wagon58329.zip ...
[INFO] Remote: unzip -o -qq -d / //wagon58329.zip
[INFO] Remote: rm -f //wagon58329.zip
...
{quote}
As you can see, there is quite a directory mismatch between the place I copied
to with scp and the place the unzip is being run.
This problem is not a pscp one, it is a one of the plugin. The same problem
occurs if I am using the scp:// url rather than the scpexe
Give it a try on one of your Unix servers ;)
> Optimized wagon plugin is trying to unzip the wrong file
> --------------------------------------------------------
>
> Key: MOJO-1536
> URL: http://jira.codehaus.org/browse/MOJO-1536
> Project: Mojo
> Issue Type: Bug
> Components: wagon
> Reporter: Denis Cabasson
> 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.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
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