[ https://issues.apache.org/jira/browse/WAGON-494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Basin updated WAGON-494: ----------------------------- Description: When running maven with stdin redirected to /dev/null or nul and connecting to unknown host, it repeats the host key prompt infininitely: {code:java} d:\ftpjob\ftpjob>mvnDebug org.codehaus.mojo:wagon-maven-plugin::sshexec@execute-test-commands <nul Listening for transport dt_socket at address: 8000 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ftpjob 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wagon-maven-plugin:1.1-SNAPSHOT:sshexec (execute-test-commands) @ ftpjob --- The authenticity of host 'localhost' can't be established. RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. Are you sure you want to continue connecting? (yes/no): The authenticity of host 'localhost' can't be established. RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. Are you sure you want to continue connecting? (yes/no): ..{code} This infinite loop is the reaction to EOF in the plexus prompter: [https://github.com/sonatype/plexus-interactivity/blob/e63b88bfd5789a4d2ac07e3f9b3b15308b2416e8/plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/DefaultPrompter.java#L147] I don't know why they wrote it like this. Maybe they should've thrown a runtime exception instead of looping. Anyway, I can't find their Jira so maybe you can direct this to the right place. Or, as a workaround, always pass a default return value ("no" in case of the host key prompt). full pom: {code:java} <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>foo</groupId> <artifactId>infloop</artifactId> <version>0.1-SNAPSHOT</version> <pluginRepositories> <pluginRepository> <id>mojohaus-snapshots</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>apache-snapshots</id> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <!-- --> </pluginRepositories> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> <executions> <execution> <id>execute-test-commands</id> <goals> <goal>sshexec</goal> </goals> <configuration> <serverId>bad-server-id</serverId> <url>scp://localhost</url> <commands> <command>pwd</command> </commands> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> <version>1.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh</artifactId> <version>3.0.1-SNAPSHOT</version><!-- default is 2.11-SNAPSHOT --> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> </project> {code} was: When running maven with closed stdin and connecting to unknown host, it repeats the host key prompt infininitely: {code:java} d:\ftpjob\ftpjob>mvnDebug org.codehaus.mojo:wagon-maven-plugin::sshexec@execute-test-commands <nul Listening for transport dt_socket at address: 8000 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ftpjob 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wagon-maven-plugin:1.1-SNAPSHOT:sshexec (execute-test-commands) @ ftpjob --- The authenticity of host 'localhost' can't be established. RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. Are you sure you want to continue connecting? (yes/no): The authenticity of host 'localhost' can't be established. RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. Are you sure you want to continue connecting? (yes/no): ..{code} This infinite loop is the reaction to EOF in the plexus prompter: [https://github.com/sonatype/plexus-interactivity/blob/e63b88bfd5789a4d2ac07e3f9b3b15308b2416e8/plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/DefaultPrompter.java#L147] I don't know why they wrote it like this. Maybe they should've thrown a runtime exception instead of looping. Anyway, I can't find their Jira so maybe you can direct this to the right place. Or, as a workaround, always pass a default return value ("no" in case of the host key prompt). full pom: {code:java} <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>foo</groupId> <artifactId>infloop</artifactId> <version>0.1-SNAPSHOT</version> <pluginRepositories> <pluginRepository> <id>mojohaus-snapshots</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>apache-snapshots</id> <url>https://repository.apache.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <!-- --> </pluginRepositories> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> <executions> <execution> <id>execute-test-commands</id> <goals> <goal>sshexec</goal> </goals> <configuration> <serverId>bad-server-id</serverId> <url>scp://localhost</url> <commands> <command>pwd</command> </commands> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>wagon-maven-plugin</artifactId> <version>1.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh</artifactId> <version>3.0.1-SNAPSHOT</version><!-- default is 2.11-SNAPSHOT --> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> </project> {code} > wagon-ssh: infinite prompts when EOF on stdin > --------------------------------------------- > > Key: WAGON-494 > URL: https://issues.apache.org/jira/browse/WAGON-494 > Project: Maven Wagon > Issue Type: Bug > Components: wagon-ssh > Environment: windows7 > Reporter: Ilya Basin > Priority: Major > > When running maven with stdin redirected to /dev/null or nul and connecting > to unknown host, it repeats the host key prompt infininitely: > {code:java} > d:\ftpjob\ftpjob>mvnDebug > org.codehaus.mojo:wagon-maven-plugin::sshexec@execute-test-commands <nul > Listening for transport dt_socket at address: 8000 > [INFO] Scanning for projects... > [INFO] > [INFO] > ------------------------------------------------------------------------ > [INFO] Building ftpjob 1.0.0-SNAPSHOT > [INFO] > ------------------------------------------------------------------------ > [INFO] > [INFO] --- wagon-maven-plugin:1.1-SNAPSHOT:sshexec (execute-test-commands) @ > ftpjob --- > The authenticity of host 'localhost' can't be established. > RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. > Are you sure you want to continue connecting? (yes/no): > The authenticity of host 'localhost' can't be established. > RSA key fingerprint is b2:83:4c:3f:39:de:55:0f:22:0b:d4:65:f3:b6:c8:8a. > Are you sure you want to continue connecting? (yes/no): > ..{code} > This infinite loop is the reaction to EOF in the plexus prompter: > [https://github.com/sonatype/plexus-interactivity/blob/e63b88bfd5789a4d2ac07e3f9b3b15308b2416e8/plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/DefaultPrompter.java#L147] > I don't know why they wrote it like this. Maybe they should've thrown a > runtime exception instead of looping. > Anyway, I can't find their Jira so maybe you can direct this to the right > place. > Or, as a workaround, always pass a default return value ("no" in case of the > host key prompt). > > full pom: > {code:java} > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>foo</groupId> > <artifactId>infloop</artifactId> > <version>0.1-SNAPSHOT</version> > <pluginRepositories> > <pluginRepository> > <id>mojohaus-snapshots</id> > <url>https://oss.sonatype.org/content/repositories/snapshots</url> > <releases> > <enabled>false</enabled> > </releases> > <snapshots> > <enabled>true</enabled> > </snapshots> > </pluginRepository> > <pluginRepository> > <id>apache-snapshots</id> > > <url>https://repository.apache.org/content/repositories/snapshots</url> > <releases> > <enabled>false</enabled> > </releases> > <snapshots> > <enabled>true</enabled> > </snapshots> > </pluginRepository> > <!-- --> > </pluginRepositories> > <build> > <plugins> > <plugin> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <source>1.7</source> > <target>1.7</target> > </configuration> > </plugin> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>wagon-maven-plugin</artifactId> > <executions> > <execution> > <id>execute-test-commands</id> > <goals> > <goal>sshexec</goal> > </goals> > <configuration> > <serverId>bad-server-id</serverId> > <url>scp://localhost</url> > <commands> > <command>pwd</command> > </commands> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > <pluginManagement> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>wagon-maven-plugin</artifactId> > <version>1.1-SNAPSHOT</version> > <dependencies> > <dependency> > <groupId>org.apache.maven.wagon</groupId> > <artifactId>wagon-ssh</artifactId> > <version>3.0.1-SNAPSHOT</version><!-- default is > 2.11-SNAPSHOT --> > </dependency> > </dependencies> > </plugin> > </plugins> > </pluginManagement> > </build> > </project> > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)