Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-263

Interactive plugins cannot work in forked executions

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0-beta-6
    • Fix Version/s: Backlog
    • Component/s: prepare
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I was looking into the problems with the GPG plugin when run from the
      release plugin and the problems seem to entirely be problems of the
      release plugin and Plexus utils. They are showing up in the gpg
      plugin, but any plugin that tries to do anything interactively would
      most likely run into the same problems.

      Issues:
      1) System.in - the release manager doesn't feed anything from System.in
      into the forked process. I tried adding System.in to the
      CommandLineUtils.executeCommandLine call, but that just causes a hang.
      CommandLineUtils will wait until the "in" stream is completely consumed
      (returns -1) before returning. With System.in, that never will happen.

      2) Buffered(line style) out - the StreamPumpers use
      BufferedInputStream.readLine() to pump from one stream to the other.
      This won't work. Anything that does something (like the release plugin
      itself) that prompts and then waits for a response on the same line will
      appear to just "hang" as the prompt will never make it to the screen.

      Basically, those two issues completely prevent us from being able to
      un-hard code GPG passphrases from build scripts and such. (unless you
      set gpg.useagent to true and use an agent)

      In anycase, MGPG-9 is really a release plugin bug although part of it is
      due to plexus-utils not providing the support it would need to work
      properly. Most likely, we'll need to add a method in CommandLineUtils
      that would just take the raw streams (in/out/err) and do straight byte
      copy reads without the line buffering. (and once the process
      completely, stop pumping the in stream) (of course, that would then
      require another plexus-utils release and then the release plugin would
      only work with Maven 2.0.6+ with the utils shaded, but that may be
      minor) I'll poke around more and see if I can come up with something.

        Issue Links

          Activity

          Hide
          Sean Flanigan added a comment -

          This breaks mvn release:prepare for me, because it appears to hang after this output:
          [INFO] Checking dependencies and plugins for snapshots ...

          The output hangs without showing the prompt
          What is the release version for "<My Project>"?

          I don't know if issue (1) still exists, but issue (2) definitely does. Is there any sort of workaround? I don't think I can put these values into my settings.xml!

          And is there any reason we can't just change StreamPumper to copy char by char? It might be slower, but at least it would work.

          Show
          Sean Flanigan added a comment - This breaks mvn release:prepare for me, because it appears to hang after this output: [INFO] Checking dependencies and plugins for snapshots ... The output hangs without showing the prompt What is the release version for "<My Project>"? I don't know if issue (1) still exists, but issue (2) definitely does. Is there any sort of workaround? I don't think I can put these values into my settings.xml! And is there any reason we can't just change StreamPumper to copy char by char? It might be slower, but at least it would work.
          Hide
          Sean Flanigan added a comment -

          Never mind, upon closer investigation, mvn release:prepare doesn't even seem to use StreamPumper, it has its own RawStreamPumper. My problem was caused by a shell alias I had forgotten about which passes mvn output through awk (which buffers by lines).

          Show
          Sean Flanigan added a comment - Never mind, upon closer investigation, mvn release:prepare doesn't even seem to use StreamPumper, it has its own RawStreamPumper. My problem was caused by a shell alias I had forgotten about which passes mvn output through awk (which buffers by lines).
          Hide
          Brett Porter added a comment -

          Brian indicated this had been a regular problem to look at

          Show
          Brett Porter added a comment - Brian indicated this had been a regular problem to look at
          Hide
          Stephen Connolly added a comment -

          Pushing back to 2.3 as this is quite a large scope of work (at a minimum for testing)

          Show
          Stephen Connolly added a comment - Pushing back to 2.3 as this is quite a large scope of work (at a minimum for testing)
          Hide
          Robert Scholte added a comment -

          Just to clearify this issue a bit:
          The release plugin has 2 MavenExecutors: The ForkedMavenExecutor (with id forked-path and the InvokerMavenExecutor (the default and with id invoker). The first one seems to run fine, the latter can hang when it requires input.
          Although the title mentions a forked execution, it doesn't refer to the ForkedMavenExecutor, but to the InvokerMavenExecutor.
          Pushing this forward to 2.4

          Show
          Robert Scholte added a comment - Just to clearify this issue a bit: The release plugin has 2 MavenExecutors : The ForkedMavenExecutor (with id forked-path and the InvokerMavenExecutor (the default and with id invoker ). The first one seems to run fine, the latter can hang when it requires input. Although the title mentions a forked execution, it doesn't refer to the ForkedMavenExecutor , but to the InvokerMavenExecutor . Pushing this forward to 2.4

            People

            • Assignee:
              Unassigned
              Reporter:
              Daniel Kulp
            • Votes:
              14 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated: