Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-494

wagon-ssh: infinite prompts when EOF on stdin

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.3
    • Component/s: wagon-ssh
    • Labels:
      None
    • Environment:
      windows7

      Description

      When running maven with stdin redirected to /dev/null or nul and connecting to unknown host, it repeats the host key prompt infininitely:

      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):
      ..

      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:

      <?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>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael-o Michael Osipov
                Reporter:
                basinilya Ilya Basin
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: