I have a Java Maven project with about 800 source files (some generated by javacc/JTB) which is taking a good 25 minutes to compile with javac.
When I changed my pom.xml
I think something like the following is going on: Maven forks javac, JVM processes for separate steps in its life-cycle: Maven Build Life-cycle
Eclipse typically runs its compile in the background (on Save), so that step will be added to the compile phase. If there are substantial dependencies, this is where you're losing throughput.
In addition (depending upon mvn configuration) each test method gets its own JVM. Since test passage is a pre-req to the package phase, it's possible that you're losing time to your JUnit test executions (particularly if they're slow running tests). This is only a likely culprit if you have a lot of test code in your source tree.
Most likely of all, your class does substantial amounts of File I/O, so that's an area of opportunity. It looks like your loop is executing 1000 times per File discovery event meaning 800*1000 =800,000 PrintStream creations in the body of the loop.