1414
1515package net .revelc .code .apilyzer .maven .plugin ;
1616
17+ import static java .nio .charset .StandardCharsets .UTF_8 ;
18+
1719import com .google .common .reflect .ClassPath ;
1820import com .google .common .reflect .ClassPath .ClassInfo ;
1921import java .io .File ;
20- import java .io .FileNotFoundException ;
2122import java .io .IOException ;
2223import java .io .PrintStream ;
2324import java .lang .annotation .Annotation ;
@@ -239,7 +240,7 @@ public class AnalyzeMojo extends AbstractMojo {
239240 private List <String > excludeAnnotations = Collections .emptyList ();
240241 private PatternSet excludeAnnotationsPs ;
241242
242- private static final String FORMAT = " %-20s %-60s %-35s %s\ n " ;
243+ private static final String FORMAT = " %-20s %-60s %-35s %s% n" ;
243244
244245 @ Override
245246 public void execute () throws MojoFailureException , MojoExecutionException {
@@ -264,7 +265,7 @@ public void execute() throws MojoFailureException, MojoExecutionException {
264265 throw new MojoExecutionException ("Error resolving project classpath" , e );
265266 }
266267
267- try (PrintStream out = new PrintStream (new File (outputFile ))) {
268+ try (PrintStream out = new PrintStream (new File (outputFile ), UTF_8 )) {
268269
269270 out .println ("Includes: " + includes );
270271 out .println ("IncludeAnnotations: " + includeAnnotations );
@@ -314,7 +315,7 @@ public void execute() throws MojoFailureException, MojoExecutionException {
314315 getLog ().error (msg );
315316 throw new MojoFailureException (msg );
316317 }
317- } catch (FileNotFoundException e ) {
318+ } catch (IOException e ) {
318319 throw new MojoExecutionException ("Bad configuration: cannot create specified outputFile" , e );
319320 }
320321 }
0 commit comments