talios / clojure-maven-plugin

Apache Maven Mojo for compiling clojure scripts to class files
251 stars 74 forks source link

Use sourceEncoding when discovering namespaces #73

Closed ez121sl closed 11 years ago

ez121sl commented 11 years ago

I finally tracked down the problem I had with one particular .clj file not being included from the .jar file. It turns out that under some circumstances, clojure-maven-plugin fails to discover a namespace in a .clj file. Those circumstances are:

It does not help the situation that java.util.Scanner just reports that it cannot find any more tokens if it encounters some "invalid" data in the stream.

This patch makes sure that project.build.sourceEncoding, if specified, is used when creating Scanner instances. Our pom files did correctly specified sourceEncoding as UTF-8.

I am not experienced in Maven plugin development, so I am not sure if this patch solves more problems than it can potentially cause. There is probably some poor soul out there who is unwittingly relying on the current behavior. At least I just wanted to draw attention to this issue.

buildhive commented 11 years ago

Mark Derricutt » clojure-maven-plugin #42 SUCCESS This pull request looks good (what's this?)

talios commented 11 years ago

Excellent spotting! Will hopefully push this out as a release tonight so everyone can benefit...