talios / clojure-maven-plugin

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

Option to include plugin dependencies on classpath for run goal #57

Closed stuartgunter closed 12 years ago

stuartgunter commented 12 years ago

Firstly, excellent plugin. It's incredibly useful and well written!

Unfortunately I think I've found a limitation in the way the classpath is constructed when using the run goal (although I think it applies more broadly, this is the one use case I've found so far). The plugin doesn't seem to include any plugin dependencies on the classpath, and there doesn't appear to be any configuration option to change this default behaviour.

Looking at the source, it seems to only include all compile-scoped dependencies. This limits the plugin to only being used on Clojure projects.

My use case was to execute a Clojure script as part of a Maven build, but the project itself was written in pure Java. This meant I was unable to use the plugin because I wasn't happy including Clojure as a compile-scoped project dependency.

Any chance we could have the option to include plugin dependencies (and possibly even an option to exclude project dependencies) when executing the run goal? Something along the lines of what the exec-maven-plugin:java goal provides?

Thanks

talios commented 12 years ago

Hi Stuart, thanks for the kind words on the plugin. Good spotting on nit supporting plugin reps, I thought they worked actually. I'll take a look in the morning and see if its an easy fix (I'm guessing its just a an annotation change somewhere) and push out a new release.

I was meaning to push another release this week as well.

Ill post to the group when its pushed out.

Mark

Sent with AquaMail for Android http://www.aqua-mail.com

On September 15, 2012 9:25:05 PM Stuart Gunter notifications@github.com wrote:

Firstly, excellent plugin. It's incredibly useful and well written!

Unfortunately I think I've found a limitation in the way the classpath is constructed when using the run goal (although I think it applies more broadly, this is the one use case I've found so far). The plugin doesn't seem to include any plugin dependencies on the classpath, and there doesn't appear to be any configuration option to change this default behaviour.

Looking at the source, it seems to only include all compile-scoped dependencies. This limits the plugin to only being used on Clojure projects.

My use case was to execute a Clojure script as part of a Maven build, but the project itself was written in pure Java. This meant I was unable to use the plugin because I wasn't happy including Clojure as a compile-scoped project dependency.

Any chance we could have the option to include plugin dependencies (and possibly even an option to exclude project dependencies) when executing the run goal? Something along the lines of what the exec-maven-plugin:java goal provides?

Thanks


Reply to this email directly or view it on GitHub: https://github.com/talios/clojure-maven-plugin/issues/57

stuartgunter commented 12 years ago

Sorry... accidentally clicked the wrong button.

If it turns out to be more work and you'd like me to help out, please let me know. It's been a while since I wrote a Maven plugin, but I'm sure I could figure it out.

Thanks for the quick response!

talios commented 12 years ago

Just a quick note to say I pushed out a new release that now includes an configuration setting for all goals to also include a plugins dependencies (note however that this is all of the plugins dependencies and not just those explicitly defined) .

There's also a new IT test on the source that shows it running.

Cheers, Mark

Sent with AquaMail for Android http://www.aqua-mail.com

On September 15, 2012 9:25:05 PM Stuart Gunter notifications@github.com wrote:

Firstly, excellent plugin. It's incredibly useful and well written!

Unfortunately I think I've found a limitation in the way the classpath is constructed when using the run goal (although I think it applies more broadly, this is the one use case I've found so far). The plugin doesn't seem to include any plugin dependencies on the classpath, and there doesn't appear to be any configuration option to change this default behaviour.

Looking at the source, it seems to only include all compile-scoped dependencies. This limits the plugin to only being used on Clojure projects.

My use case was to execute a Clojure script as part of a Maven build, but the project itself was written in pure Java. This meant I was unable to use the plugin because I wasn't happy including Clojure as a compile-scoped project dependency.

Any chance we could have the option to include plugin dependencies (and possibly even an option to exclude project dependencies) when executing the run goal? Something along the lines of what the exec-maven-plugin:java goal provides?

Thanks


Reply to this email directly or view it on GitHub: https://github.com/talios/clojure-maven-plugin/issues/57

stuartgunter commented 12 years ago

Wow... that was fast! I just tested this out against the 1.3.12 release in Sonatype OSS and seems to work really well.

Thanks!

talios commented 12 years ago

I aim to please ;-) The release should be in central by now as well. It'd helped the day was full of rain and not the nicest.