This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Below is a simple command line app. I made it as simple as possible to communicate my problem with running command line apps in NetBeans if I use the Maven plugin. If I create a regular Java project, put in this code, and run the project, the app works fine. If I create a Maven project using the Maven plugin and NetBeans 6.5.1, and put in this code, the prompt does not appear and my input does not get processed. Also, the only way to stop running the app is to shut NetBeans. Clicking the x boxes does nothing. What am I doing wrong? package delme; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static String readln() { InputStreamReader inputStrReader = new InputStreamReader(System.in); BufferedReader buffRdr = new BufferedReader(inputStrReader); String str = null; try { str = buffRdr.readLine(); } catch (IOException ioe) { System.err.println(ioe); } return str; } public static void main(String[] args) { while (true) { System.out.print("> "); String str = readln(); String[] input = str.split("\\s"); if (input[0].equals("exit") || input[0].equals("quit")) { System.exit(0); } System.out.println("You said " + str + " and length = " + input.length); for (int x = 0; x < input.length; x++) { System.out.println(input[x]); } for (int i = 0; i < input.length; i++) { } } } }
Confirming in 6.7 dev. Process output does not seem connected to the output window.
the issue is most likely in the external project - exec-maven-plugin. http://jira.codehaus.org/browse/MEXEC-25 While I'll try to create a patch for the exec plugin, it cannot be determined when the patch appears in a release version of exec-maven-plugin. Thus setting milestone to "next".
*** Issue 170229 has been marked as a duplicate of this issue. ***
applied in mojo.codehaus.org svn repository. I've deployed a snapshot for testing at http://snapshots.repository.codehaus.org/org/codehaus/mojo/exec-maven-plugin/1.1.2-SNAPSHOT/ to use it, declare the s.r.c.org repository in settings.xml file and then change the action mapping in the IDE to 1.1.2-SNAPSHOT (instead of the current 1.1.1)
Fixed by exec-maven-plugin 1.2, see also issue 188864.
Verified in older build of NetBeans (which does not include fix of #188864) by changing Run Project action's Execute Goals property to use 1.2 in project's Properties/Actions which adds the following configuration to nbactions.xml in project's root <?xml version="1.0" encoding="UTF-8"?> <actions> <action> <actionName>run</actionName> <goals> <goal>process-classes</goal> <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal> </goals> <properties> <exec.classpathScope>runtime</exec.classpathScope> <exec.args>-classpath %classpath ${packageClassName}</exec.args> <exec.executable>java</exec.executable> </properties> </action> </actions>
Verified also with a new project created with the latest dev build which contains the fix of #188864. By default version 1.2 of exec-maven-plugin is used and the process output/input is correctly bound to Output window.
*** This bug has been marked as a duplicate of bug 188864 ***