使用maven-wagon-plugin和Maven 3.2.5,我试图覆盖KnownHostsProvider
中ScpWagon
的默认实现。这是我的配置:
的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://userY@serverX.host</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>
在mvnDebug deploy
之后运行DefaultWagonManager.getWagon(repository)
并设置断点,我仍然看到FileKnownHostsProvider
实例中设置了ScpWagon
的实例。
我尝试过使用Maven 3.0.X和3.1.X,结果是一样的。我错过了什么?