Maven server configuration settings.xml not entered into Wagon instance

Using maven-wagon-plugin and Maven 3.2.5, I am trying to override the default implementation of KnownHostsProvider inside 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:// 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> 

Starting mvnDebug deploy and setting a breakpoint after DefaultWagonManager.getWagon(repository) , I still see that the FileKnownHostsProvider instance FileKnownHostsProvider installed in the ScpWagon instance.

I tried with Maven 3.0.X as well as 3.1.X, the result is the same. What am I missing?

+5
source share

Source: https://habr.com/ru/post/1214476/


All Articles