I think the main issue is it is running in a forked JVM, but I am not sure, since I haven't gotten to the low-level details. It runs fine if I call the goal from the command line (and not as part of a preparationGoal during release)

My guess is that Plexus is somehow redirecting the owner process System.in and passing it to the forked process, but I really have no clue. All I know is it hangs on bufferedReader.readLine()

-Grant

On May 11, 2007, at 10:08 AM, Daniel Kulp wrote:

On Thursday 10 May 2007 16:35, Wayne Fay wrote:
In M2, things like this are generally either passed as parameters
(-D...) or simply specified as configurations for the plugin in the
pom.xml configuration.

Actually, I can't think of a single M2 plugin that prompts the user
for input while processing etc. There is probably a good reason for
this (the forked JVM etc) so perhaps reconsider your approach?

The GPG plugin will prompt for a passphrase.   It just uses straight
System.in stuff without a problem.   Not sure why it works and yours
doesn't.

Dan



Wayne

On 5/10/07, Grant Ingersoll <[EMAIL PROTECTED]> wrote:
Hi,

Long time M1 user upgrading to M2...

I have a Mojo that I have written that asks for user input
concerning it's operation (I use a BufferedReader wrapping
System.in).  When I run the goal standalone, everything works fine.
However, when I run the goal as preparationGoal of the
maven-release-plugin, it hangs and never seems to get the input from
the command line.  I think the issue lies in the fact that it is a
forked JVM but I am not sure.  I have trouble debugging it, b/c the
debugging options specified in the mvn command (via MAVEN_OPTS)
don't work b/c I get errors saying the port is already in use (it
starts up and listens on the port, but then a subprocess seems to
try to acquire the same port, resulting in an error.)

Below is the code I have in my mojo.


BufferedReader reader
                 = new BufferedReader(new
InputStreamReader(System.in)); String line = null;
             try
             {
                 getLog().warn("Pre loop");
                 while (true)
                 {
                     getLog().warn
                         (tagDir
                          + " exists in the repository - [d]elete or
[a]bort?");
                     line = reader.readLine();
                     getLog().debug("Before check: " + line);
                     if (line.equalsIgnoreCase("a") ||
line.equalsIgnoreCase("d"))
                     {
                         break;
                     }
                     getLog().debug("Here: " + line);
                 }

                 getLog().warn("Line: " + line);
                 if (getLog().isDebugEnabled())
                 {
                     getLog().debug("Line: " + line);
                 }

Thanks,
Grant

--------------------------
Grant Ingersoll
Center for Natural Language Processing
http://www.cnlp.org/tech/lucene.asp

Read the Lucene Java FAQ at http://wiki.apache.org/jakarta-lucene/
LuceneFAQ



--------------------------------------------------------------------
- To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


------------------------------------------------------
Grant Ingersoll
http://www.grantingersoll.com/
http://lucene.grantingersoll.com
http://www.paperoftheweek.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to