clojure-maven-plugin
clojure-maven-plugin copied to clipboard
Plugin picks up all files in the source/test folders
I know the intention is to pick up only *.clj and *.cljc, but this code in NamespaceDiscovery.java:
scanner.addSourceMapping(new SuffixMapping(".clj", new HashSet(Arrays.asList(".clj", "__init.class"))));
scanner.addSourceMapping(new SuffixMapping(".cljc", new HashSet(Arrays.asList(".cljc", "__init.class"))));
only affects the StaleSourceScanner implementation. The SimpleSourceInclusionScanner needs to have the inclusion/exclusion collections initialized on construction - so, something like this:
protected SourceInclusionScanner getSourceInclusionScanner(boolean includeStale) {
return includeStale ? new SimpleSourceInclusionScanner(Sets.newHashSet("**/*.clj", "**/*.cljc"),
Collections.EMPTY_SET) : new StaleSourceScanner(1024);
}
Without the fix the plugin is trying to compile any files it finds in the source directories (.cljs in my case) failing the whole build.