talios / clojure-maven-plugin

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

sourceDirectories and Absolute Paths #52

Closed semperos closed 8 years ago

semperos commented 12 years ago

The clojure-maven-plugin behaves differently from other plugins that allow adding source paths, even including clojure-maven-plugin's own ClojureAddSourceMojo.

In the translatePaths method of the AbstractClojureCompilerMojo class, you manually prepend baseDirectory onto the values captured in sourceDirectories, whereas the proper way seems to be calling .getAbsolutePath on File objects like ClojureAddSourceMojo does. Here are the two code examples:

https://github.com/talios/clojure-maven-plugin/blob/develop/src/main/java/com/theoryinpractise/clojure/AbstractClojureCompilerMojo.java#L231

https://github.com/talios/clojure-maven-plugin/blob/develop/src/main/java/com/theoryinpractise/clojure/ClojureAddSourceMojo.java#L15

For example, I am putting some generated Clojure code into <project>/target/src/main/clojure of my project, but if I try to configure clojure-maven-plugin's sourceDirectories -> sourceDirectory with ${project.build.directory}/src/main/clojure}, clojure-maven-plugin doesn't find my source files, whereas the equivalent configuration works fine for both the maven-build-helper-plugin and the jruby-maven-plugin, both of which take the .getAbsolutePath approach.

semperos commented 8 years ago

Haven't touched or looked at this in a long time, closing.

talios commented 8 years ago

My bad - I didn't even SEE this ticket :( c-m-p is largely idle these days, unless someone shouts at me loudly.

semperos commented 8 years ago

Absolutely no problem. I was finally doing some cleaning up of issues and PR's I've opened across Github projects. Thanks for your contributions to the Clojure community, they're much appreciated.