Wagon SSH/SCP configuration

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Wagon SSH/SCP configuration

Sean James
I am trying to use wagon ssh to scp files to a system. The source systems
are created on the fly so I cannot add them to the known hosts file like I
would normally do. From a terminal on these ad hoc systems I can use the
"-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" options, but
when I try this in the wagon configuration module I get an error message.

[INFO] [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.6:deploy (default-deploy) on
project codebuild_test: Unable to configure Wagon: 'scp': While configuring
wagon for 'site.deployment': Unable to apply wagon configuration. Cannot
find 'strictHostKeyChecking' in class
org.apache.maven.wagon.providers.ssh.jsch.ScpWagon -> [Help 1]


My server section in settings.xml looks like this

                <server>
                        <id>site.deployment</id>
                        <username>username</username>
                        <password>password</password>
                        <configuration>

<strictHostKeyChecking>no</strictHostKeyChecking>
                                <interactive>false</interactive>

<UserKnownHostsFile>/dev/null</UserKnownHostsFile>
                        </configuration>
                </server>


Is there a way to get wagon to use those options?

Wagon definition here

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</plugin>

Any assistance would be greatly appreciated as I am at a standstill at the
moment.

Regards.

--
Sean James
DevOps Engineer
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Wagon SSH/SCP configuration

Anthony Whitford
Wouldn’t one typically specify a privateKey and passphrase, instead of a password, when using SSH?

I see that there is a NullKnownHostProvider <https://maven.apache.org/wagon/wagon-providers/wagon-ssh-common/apidocs/org/apache/maven/wagon/providers/ssh/knownhost/NullKnownHostProvider.html>, so maybe a google search for that may lead to an answer…
  - https://stackoverflow.com/questions/8323040/maven-wagon-scp-is-not-able-to-establish-a-connection <https://stackoverflow.com/questions/8323040/maven-wagon-scp-is-not-able-to-establish-a-connection>
I found a super secret documentation page that may be helpful:
 - https://maven.apache.org/wagon/wagon-providers/wagon-ssh/configuration.html <https://maven.apache.org/wagon/wagon-providers/wagon-ssh/configuration.html>
(According to this, the default will fallback to NullKnownHostProvider, so perhaps you have nothing to do.)
Also note that the latest wagon-ssh is version 3.3.2, so an upgrade may be helpful.

I’ve had past success using SCP for deploying Site.  You may want to review:  https://maven.apache.org/plugins/maven-site-plugin/usage.html <https://maven.apache.org/plugins/maven-site-plugin/usage.html>

Hope this helps,

Anthony



> On Feb 14, 2019, at 8:56 AM, Sean James <[hidden email]> wrote:
>
> I am trying to use wagon ssh to scp files to a system. The source systems
> are created on the fly so I cannot add them to the known hosts file like I
> would normally do. From a terminal on these ad hoc systems I can use the
> "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" options, but
> when I try this in the wagon configuration module I get an error message.
>
> [INFO] [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-site-plugin:3.6:deploy (default-deploy) on
> project codebuild_test: Unable to configure Wagon: 'scp': While configuring
> wagon for 'site.deployment': Unable to apply wagon configuration. Cannot
> find 'strictHostKeyChecking' in class
> org.apache.maven.wagon.providers.ssh.jsch.ScpWagon -> [Help 1]
>
>
> My server section in settings.xml looks like this
>
>                <server>
>                        <id>site.deployment</id>
>                        <username>username</username>
>                        <password>password</password>
>                        <configuration>
>
> <strictHostKeyChecking>no</strictHostKeyChecking>
>                                <interactive>false</interactive>
>
> <UserKnownHostsFile>/dev/null</UserKnownHostsFile>
>                        </configuration>
>                </server>
>
>
> Is there a way to get wagon to use those options?
>
> Wagon definition here
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-site-plugin</artifactId>
> <version>3.7.1</version>
> <dependencies>
> <dependency>
> <groupId>org.apache.maven.wagon</groupId>
> <artifactId>wagon-ssh</artifactId>
> <version>3.1.0</version>
> </dependency>
> </dependencies>
> </plugin>
>
> Any assistance would be greatly appreciated as I am at a standstill at the
> moment.
>
> Regards.
>
> --
> Sean James
> DevOps Engineer
> [hidden email]