I currently have a Maven application within Netbeans. Since I need to use regular expressions within my project, I added the following class to one of my packages : http://docs.oracle.com/javase/tutorial/essential/regex/test_harness.html
I changed all the Input/Output statements to use System.out and BufferedReader. When I run this class from a fresh project, the class works as expected. But when I add it to my Maven project, I can see no output after :
NetBeans: Executing '/usr/share/maven2/bin/mvn -Dexec.classpathScope=runtime -Dexec.args=-classpath %classpath MySource.RegexTestHarness -Dexec.executable=/home/gowri/jdk1.6.0_20/bin/java -Dnetbeans.execution=true process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec' NetBeans: JAVA_HOME=/home/gowri/jdk1.6.0_20
Scanning for projects...
Building crawler4j task-segment: [process-classes, org.codehaus.mojo:exec-maven-plugin:1.1.1:exec]
[enforcer:enforce]
[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources
[compiler:compile]
Compiling 1 source file to /home/gowri/WORKSPACE/yasserg-crawler4j-7b8bf91/target/classes
[exec:exec]
Could anyone please tell me why this is happening ? I made sure that this class is the only one with a main() function in it, and I click on "Run file" and not on "Run Project".
Thank you :)
EDIT : I just realized something, when I convert all the System.out.print() statements to System.out.println(), only then can I see the correct output. Any ideas why ?