I have a Maven project (in Eclipse using the m2eclipse plugin) that contains code in two different languages (Java and Clojure).
Ideally I’d like two separate source folders for the two languages:
- src/main/java
- src/main/clj
Eclipse is happy with having two source directories defined in the project. However, as far as I can work out, Maven only supports a single source directory as follows:
<build>
....
<sourceDirectory>src/main/java</sourceDirectory>
....
</build>
If I add a second sourceDirectory to the pom.xml, I get an error…..
Is there a recommended way to configure this kind of polyglot project in Maven?
I don’t believe you need to do that; the Clojure plugin should already know how to find Clojure source (although IIRC it defaults to src/main/clojure).
See here for some details.