You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Timothy Riley (JIRA)" <ji...@codehaus.org> on 2009/04/15 06:42:12 UTC

[jira] Created: (WAGON-258) SSH / SCP -o options should be quoted

SSH / SCP -o options should be quoted
-------------------------------------

                 Key: WAGON-258
                 URL: http://jira.codehaus.org/browse/WAGON-258
             Project: Maven Wagon
          Issue Type: Bug
          Components: wagon-ssh-external
    Affects Versions: 1.0-beta-5
         Environment: Maven 2.1.0 and Java 1.5.0_15
            Reporter: Timothy Riley


I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
be placed in quotations unfortunately I cannot deviate from this technology.
The problem is that ScpExternalWagon.java places the BatchMode option as an
argument without quotes resulting in a failing SSH command.

Line 251 of ScpExternalWagon.java
   cl.createArgument().setValue( "BatchMode yes" );

Results in...
ssh -o BatchMode yes [REST OF COMMAND]

What I need is...
ssh -o "BatchMode yes" [REST OF COMMAND]


-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173003#action_173003 ] 

Brett Porter commented on WAGON-258:
------------------------------------

it seems overriding the ssh wagon works, but not the ssh-external wagon due to the following:

{code}
[DEBUG] No wagons found in the extensions or other internal error: Unable to lookup component 'org.apache.maven.wagon.Wagonscp', it could not be started
org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.wagon.Wagonscp', it could not be started
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
...
Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed for the field knownHostsProvider in object of type org.apache.maven.wagon.providers.ssh.jsch.ScpWagon
        at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:144)
{code}

I'll continue investigating to see if this is a problem in the metadata of the external wagon.

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173002#action_173002 ] 

Brett Porter commented on WAGON-258:
------------------------------------

I had particularly fixed an issue in 2.1.0 to make this possible - I'll check

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Timothy Riley (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173009#action_173009 ] 

Timothy Riley commented on WAGON-258:
-------------------------------------

I had seen that exact exception even while using version 1.0-beta-5 of the wagon-ssh-external. 
This is great news though I will test that solution and I appreciate all your effort.

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Timothy Riley (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172999#action_172999 ] 

Timothy Riley commented on WAGON-258:
-------------------------------------

Brett Porter 
Has suggested the following workarounds...

One quick workaround might be to put an intervening script in between  
maven and the PATH that corrects the problem, something like: http://blogs.exist.com/bporter/2008/02/25/working-around-non-interactive-problems-in-leopards-subversion/

> My other option and my prefered option is to
> submit a patch that gets rolled into the nightly build of the wagon
> provider.

This would be best - certainly submit the issue and patch to be rolled  
in. Adding the quotes is not harmful to openssh, so I'd say it's ok to  
add them for all cases.

I wouldn't recommend using a snapshot though - instead it's best if  
you release the library internally (1.0-beta-5-MYCOMPANY-1) and use  
that. This assumes you've set up your own repository and the builds  
all use it.

Adding the following will then override the Maven one:
<build>
   <extensions>
     <extension>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-ssh-external</artifactId>
       <version>1.0-beta-5-MYCOMPANY-1</version>
     </extension>
   </extensions>
</build>

Once the Wagon is formally released you can replace the version with  
the new one.

Cheers,
Brett 

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Timothy Riley (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173001#action_173001 ] 

Timothy Riley commented on WAGON-258:
-------------------------------------

Brett
I have tested the suggested workaround by building my own 1.0-beta-5-MYCOMPANY-1 version of the wagon-ssh-external with the quotation fix but this does not work.

Steps I followed:
  1. Extracted wagon-ssh-external-1.0-beta-5-source.jar
  2. Modified ScpExternalWagon line 251 to correct the quotation issue
  3. Copied wagon-ssh-external-1.0-beta-5.pom to pom.xml and modified the version to 1.0-beta-5-MYCOMPANY-1
  4. Modified my demo project pom file with the suggestion in the workaround
  5. Executed mvnDebug -X deploy

The result is my code is never executed even though maven debug clearly says it is selected for runtime. My theory is that there is a classloading issue. With the release of maven-2.1.0 the maven-2.1.0-uber.jar came packaged with wagon ssh external. Because of this the ScpExternalWagon in maven-2.1.0-uber.jar is used over my version.

I hope my theory turns out to be incorrect because this would mean wagon ssh external could not be updated without updating maven.

Thanks
Tim

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Updated: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated WAGON-258:
-------------------------------

    Fix Version/s: 1.0

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>             Fix For: 1.0
>
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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

        

[jira] Commented: (WAGON-258) SSH / SCP -o options should be quoted

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/WAGON-258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173004#action_173004 ] 

Brett Porter commented on WAGON-258:
------------------------------------

ok, if you *also* add the SCP wagon as well like this:

{code:xml}
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-5</version>
</extension>
{code}

it should work. This stops the extension initialization from crashing making sure the new ssh-external is loaded properly. I'll file a bug in Maven for this.

> SSH / SCP -o options should be quoted
> -------------------------------------
>
>                 Key: WAGON-258
>                 URL: http://jira.codehaus.org/browse/WAGON-258
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh-external
>    Affects Versions: 1.0-beta-5
>         Environment: Maven 2.1.0 and Java 1.5.0_15
>            Reporter: Timothy Riley
>
> I'm currently using Reflection Secure IT, which requires all SSH / SCP -o options
> be placed in quotations unfortunately I cannot deviate from this technology.
> The problem is that ScpExternalWagon.java places the BatchMode option as an
> argument without quotes resulting in a failing SSH command.
> Line 251 of ScpExternalWagon.java
>    cl.createArgument().setValue( "BatchMode yes" );
> Results in...
> ssh -o BatchMode yes [REST OF COMMAND]
> What I need is...
> ssh -o "BatchMode yes" [REST OF COMMAND]

-- 
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