Zammo Holtenhoffen
Zammo Holtenhoffen

Reputation: 83

Maven settings.xml server configuration not injected into Wagon instance

Using the maven-wagon-plugin and Maven 3.2.5, I'm trying to override the default implementation of KnownHostsProvider within ScpWagon. Here is my configuration:

pom.xml:

<project>
...
    <build>
        <plugins>           
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>upload-assemblies</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>upload</goal>
                        </goals>
                        <configuration>
                            <serverId>serverX</serverId>
                            <fromDir>C:\localDir</fromDir>
                            <includes>*.zip,*.ear</includes>
                            <url>scp://[email protected]</url>
                            <toDir>/remoteDir</toDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.8</version>
            </extension>
        </extensions>
    </build>
</project>

settings.xml:

<servers>
    <server>
        <id>serverX</id>
        <configuration>
            <knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
                <hostKeyChecking>no</hostKeyChecking>
            </knownHostsProvider>
        </configuration>
        <username>userY</username>
        <password>XXXXXXXX</password>
    </server>
</servers>

Running mvnDebug deploy and setting a breakpoint after DefaultWagonManager.getWagon(repository), I still see an instance of FileKnownHostsProvider is set in the ScpWagon instance.

I have tried with Maven 3.0.X and also 3.1.X, the outcome is the same. What am I missing?

Upvotes: 5

Views: 1004

Answers (0)

Related Questions